|
219 | 219 | // @description:zu ⚡ Terus menghasilkan imibuzo eminingi ye-ChatGPT ngokwesizulu
|
220 | 220 | // @author Adam Lui
|
221 | 221 | // @namespace https://github.com/adamlui
|
222 |
| -// @version 2025.3.31 |
| 222 | +// @version 2025.4.1 |
223 | 223 | // @license MIT
|
224 | 224 | // @icon https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-continue@a8c9387/assets/images/icons/continue-symbol/black/icon48.png
|
225 | 225 | // @icon64 https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-continue@a8c9387/assets/images/icons/continue-symbol/black/icon64.png
|
|
369 | 369 | // Define MENU functions
|
370 | 370 |
|
371 | 371 | const toolbarMenu = {
|
372 |
| - ids: [], state: { |
| 372 | + state: { |
373 | 373 | symbols: ['❌', '✔️'], separator: env.scriptManager.name == 'Tampermonkey' ? ' — ' : ': ',
|
374 | 374 | words: [app.msgs.state_off.toUpperCase(), app.msgs.state_on.toUpperCase()]
|
375 | 375 | },
|
|
382 | 382 | register() {
|
383 | 383 |
|
384 | 384 | // Show "Disabled (extension active)"
|
385 |
| - if (env.extensionActive) |
| 385 | + this.ids = env.extensionActive ? [ |
386 | 386 | GM_registerMenuCommand(`${this.state.symbols[0]} ${
|
387 | 387 | toTitleCase(app.msgs.state_disabled)} (${app.msgs.menuLabel_extensionActive})`,
|
388 | 388 | () => modals.open('about'), env.scriptManager.supportsTooltips ? { title: ' ' } : undefined )
|
| 389 | + ] |
389 | 390 |
|
390 | 391 | // ...or add settings toggles
|
391 |
| - else Object.keys(settings.controls).forEach(key => { |
| 392 | + : Object.keys(settings.controls).map(key => { |
392 | 393 | const menuLabel = `${ settings.controls[key].symbol || this.state.symbols[+settings.isEnabled(key)] } `
|
393 | 394 | + settings.controls[key].label
|
394 | 395 | + this.state.separator + this.state.words[+settings.isEnabled(key)]
|
395 |
| - this.ids.push(GM_registerMenuCommand(menuLabel, () => { |
| 396 | + return GM_registerMenuCommand(menuLabel, () => { |
396 | 397 | settings.save(key, !config[key]) ; syncConfigToUI({ updatedKey: key })
|
397 | 398 | notify(`${settings.controls[key].label}: ${
|
398 | 399 | this.state.words[+(/disabled/i.test(key) ^ config[key])]}`)
|
399 |
| - }, env.scriptManager.supportsTooltips ? { title: settings.controls[key].helptip || ' ' } : undefined)) |
| 400 | + }, env.scriptManager.supportsTooltips ? { title: settings.controls[key].helptip || ' ' } : undefined) |
400 | 401 | });
|
401 | 402 |
|
402 | 403 | // Add About/Donate entries
|
403 | 404 | ['about', 'donate'].forEach(entryType => {
|
404 | 405 | if (entryType === 'donate' && env.extensionActive) return
|
405 | 406 | this.ids.push(GM_registerMenuCommand(
|
406 |
| - `${ entryType == 'about' ? '💡' : '💖' }` |
407 |
| - + ` ${app.msgs[`menuLabel_${entryType}`]} ${ entryType == 'about' ? app.msgs.appName : '' }`, |
| 407 | + `${ entryType == 'about' ? '💡' : '💖' } ${ |
| 408 | + app.msgs[`menuLabel_${entryType}`]} ${ entryType == 'about' ? app.msgs.appName : '' }`, |
408 | 409 | () => modals.open(entryType), env.scriptManager.supportsTooltips ? { title: ' ' } : undefined
|
409 | 410 | ))
|
410 | 411 | })
|
|
0 commit comments