Skip to content

Commit

Permalink
Added // @contributionURL ↞ [auto-sync from `adamlui/chatgpt-apps/c…
Browse files Browse the repository at this point in the history
…hatgpt-auto-refresh`]
  • Loading branch information
adamlui authored and kudo-sync-bot committed Jun 20, 2024
1 parent d738313 commit e96879a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 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 2024.6.17
// @version 2024.6.20
// @license MIT
// @match *://chatgpt.com/*
// @match *://chat.openai.com/*
Expand Down Expand Up @@ -251,6 +251,7 @@
// @updateURL https://update.greasyfork.org/scripts/462422/chatgpt-auto-refresh.meta.js
// @homepageURL https://www.chatgptautorefresh.com
// @supportURL https://support.chatgptautorefresh.com
// @contributionURL https://github.com/sponsors/adamlui
// ==/UserScript==

// Documentation: https://docs.chatgptautorefresh.com
Expand Down Expand Up @@ -313,7 +314,7 @@

// Init MENU objs
const menuIDs = [] // to store registered cmds for removal while preserving order
const state = {
const menuState = {
symbol: ['❌', '✔️'], word: ['OFF', 'ON'],
separator: getUserscriptManager() == 'Tampermonkey' ? ' — ' : ': '
}
Expand Down Expand Up @@ -401,38 +402,38 @@
function registerMenu() {

// Add command to toggle auto-refresh
const arLabel = state.symbol[+!config.arDisabled] + ' '
const arLabel = menuState.symbol[+!config.arDisabled] + ' '
+ ( msgs.menuLabel_autoRefresh || 'Auto-Refresh' ) + ' ↻ '
+ state.separator + state.word[+!config.arDisabled]
+ menuState.separator + menuState.word[+!config.arDisabled]
menuIDs.push(GM_registerMenuCommand(arLabel, () => {
document.getElementById('arSwitchSpan').click()
}))

// Add command to toggle visibility of toggle
const tvLabel = state.symbol[+!config.toggleHidden] + ' '
const tvLabel = menuState.symbol[+!config.toggleHidden] + ' '
+ ( msgs.menuLabel_toggleVis || 'Toggle Visibility' )
+ state.separator + state.word[+!config.toggleHidden]
+ menuState.separator + menuState.word[+!config.toggleHidden]
menuIDs.push(GM_registerMenuCommand(tvLabel, () => {
saveSetting('toggleHidden', !config.toggleHidden)
navToggleDiv.style.display = config.toggleHidden ? 'none' : 'flex' // toggle visibility
if (!config.notifDisabled) notify((
msgs.menuLabel_toggleVis || 'Toggle Visibility' ) + ': '+ state.word[+!config.toggleHidden])
msgs.menuLabel_toggleVis || 'Toggle Visibility' ) + ': '+ menuState.word[+!config.toggleHidden])
refreshMenu()
}))

// Add command to show notifications when switching modes
const mnLabel = state.symbol[+!config.notifDisabled] + ' '
const mnLabel = menuState.symbol[+!config.notifDisabled] + ' '
+ ( msgs.menuLabel_modeNotifs || 'Mode Notifications' )
+ state.separator + state.word[+!config.notifDisabled]
+ menuState.separator + menuState.word[+!config.notifDisabled]
menuIDs.push(GM_registerMenuCommand(mnLabel, () => {
saveSetting('notifDisabled', !config.notifDisabled)
notify(( msgs.menuLabel_modeNotifs || 'Mode Notifications' ) + ': ' + state.word[+!config.notifDisabled])
notify(( msgs.menuLabel_modeNotifs || 'Mode Notifications' ) + ': ' + menuState.word[+!config.notifDisabled])
refreshMenu()
}))

// Add command to change refresh interval
const riLabel = '⌚ ' + ( msgs.menuLabel_refreshInt || 'Refresh Interval' ) + ' '
+ state.separator + config.refreshInterval + 's'
+ menuState.separator + config.refreshInterval + 's'
menuIDs.push(GM_registerMenuCommand(riLabel, () => {
while (true) {
const refreshInterval = prompt(
Expand Down

0 comments on commit e96879a

Please sign in to comment.