|
225 | 225 | // @description:zu Dlala izimpendulo ze-ChatGPT ngokuzenzakalela
|
226 | 226 | // @author Adam Lui
|
227 | 227 | // @namespace https://github.com/adamlui
|
228 |
| -// @version 2025.1.29.1 |
| 228 | +// @version 2025.1.29.2 |
229 | 229 | // @license MIT
|
230 | 230 | // @icon https://assets.chatgptautotalk.com/images/icons/openai/black/icon48.png?v=9f1ed3c
|
231 | 231 | // @icon64 https://assets.chatgptautotalk.com/images/icons/openai/black/icon64.png?v=9f1ed3c
|
|
291 | 291 | support: 'https://support.chatgptautotalk.com',
|
292 | 292 | update: 'https://gm.chatgptautotalk.com'
|
293 | 293 | },
|
294 |
| - latestResourceCommitHash: 'ded5e95' // for cached messages.json + navicon in toggles.sidebar.insert() |
| 294 | + latestResourceCommitHash: 'f260579' // for cached messages.json + navicon in toggles.sidebar.insert() |
295 | 295 | }
|
296 | 296 | app.urls.resourceHost = app.urls.gitHub.replace('github.com', 'cdn.jsdelivr.net/gh')
|
297 | 297 | + `@${app.latestResourceCommitHash}`
|
|
774 | 774 | }
|
775 | 775 |
|
776 | 776 | // Update color/state
|
777 |
| - this.updateAesthetic() ; this.updateState() // to opposite init state for animation on 1st load |
| 777 | + this.updateNavicon() ; this.updateState() // to opposite init state for animation on 1st load |
778 | 778 |
|
779 | 779 | // Add hover/click listeners
|
780 | 780 | this.div.onmouseover = this.div.onmouseout = event => // trigger OpenAI hover overlay
|
|
853 | 853 | sidebar.insertBefore(this.div, sidebar.children[1]) ; this.status = 'inserted'
|
854 | 854 | },
|
855 | 855 |
|
856 |
| - updateAesthetic() { // to match UI scheme |
| 856 | + updateNavicon() { // to match UI scheme |
857 | 857 | const isDarkScheme = env.ui.scheme == 'dark'
|
858 | 858 | this.div.classList.add(isDarkScheme ? 'dark' : 'light')
|
859 | 859 | this.div.classList.remove(isDarkScheme ? 'light' : 'dark')
|
860 |
| - this.navicon.src = `${app.urls.resourceHost }/assets/images/icons/speaker/${ |
861 |
| - env.ui.scheme == 'dark' ? 'white' : 'black' }-icon.svg` |
| 860 | + this.navicon.src = `${app.urls.resourceHost }/assets/images/icons/soundwave` |
| 861 | + + `/${ config.autoTalkDisabled ? '' : 'tall-thick' }` |
| 862 | + + `/${ env.ui.scheme == 'dark' ? 'white' : 'black' }.svg` |
862 | 863 | },
|
863 | 864 |
|
864 | 865 | updateState() {
|
|
867 | 868 | this.toggleInput.checked = !config.autoTalkDisabled
|
868 | 869 | this.toggleLabel.innerText = `${app.msgs.mode_autoTalk} `
|
869 | 870 | + app.msgs[`state_${ this.toggleInput.checked ? 'enabled' : 'disabled' }`]
|
| 871 | + this.updateNavicon() |
870 | 872 | setTimeout(() => {
|
871 | 873 | this.switchSpan.className = this.toggleInput.checked ? 'enabled' : 'disabled'
|
872 | 874 | this.knobSpan.style.transform = `translateX(${ this.toggleInput.checked ? 13 : 0 }px)`
|
|
916 | 918 | function handleSchemePrefChange() {
|
917 | 919 | const displayedScheme = getScheme()
|
918 | 920 | if (env.ui.scheme != displayedScheme) {
|
919 |
| - env.ui.scheme = displayedScheme ; toggles.sidebar.updateAesthetic() ; modals.stylize() } |
| 921 | + env.ui.scheme = displayedScheme ; toggles.sidebar.updateNavicon() ; modals.stylize() } |
920 | 922 | }
|
921 | 923 |
|
922 | 924 | // Disable distracting SIDEBAR CLICK-ZOOM effect
|
|
0 commit comments