|
235 | 235 | // @description:zu Thuthukisa iChatGPT ngemodi zesikrini ezibanzi/egcwele/ephezulu + imodi yokuvimbela i-spam. Futhi isebenza ku-poe.com! |
236 | 236 | // @author Adam Lui |
237 | 237 | // @namespace https://github.com/adamlui |
238 | | -// @version 2025.9.5.15 |
| 238 | +// @version 2025.9.5.17 |
239 | 239 | // @license MIT |
240 | 240 | // @icon https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?v=844b16e |
241 | 241 | // @icon64 https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?v=844b16e |
|
258 | 258 | // @require https://cdn.jsdelivr.net/npm/json5@2.2.3/dist/index.min.js#sha256-S7ltnVPzgKyAGBlBG4wQhorJqYTehj5WQCrADCKJufE= |
259 | 259 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@152a535/chromium/extension/lib/browser.js#sha256-7teBecqrjkazKH6oetGyxKlBkAk5U9ota/LNCB3Q+Jw= |
260 | 260 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@dd4f5ac/chromium/extension/lib/chatbar.js#sha256-YUVTAFP+pS5dYG//S0j8anbrR4IdGaqyfMzyHYJLmKk= |
| 261 | +// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@ca09ef2/chromium/extension/lib/feedback.js#sha256-+pCdFOvlfPkjBY2uk+6waX+K+NPkJ6teEBY2qSlUnuo= |
261 | 262 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@01bcbd6/chromium/extension/lib/settings.js#sha256-gfnbziJG+aHUeYEYi55OUTC/mHpy4DF3SeDGX32s+i8= |
262 | 263 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@22c8c58/chromium/extension/lib/styles.js#sha256-B2atf6x6EB2a1cEFMmfVjalQA2OKeIkyAFWYpzQF7is= |
263 | 264 | // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@0697e67/chromium/extension/lib/sync.js#sha256-TgnlMU6Y+2hW2YDsPuzvndeYQ2lZEqWOGmF++7CQ7nE= |
|
421 | 422 | return words.join(' ') // join'em back together |
422 | 423 | } |
423 | 424 |
|
424 | | - // Define FEEDBACK functions |
425 | | - |
426 | | - window.notify = function(msg, pos = '', notifDuration = '', shadow = '') { |
427 | | - if (!styles.toast.node) styles.update({ key: 'toast' }) |
428 | | - if (config.notifDisabled |
429 | | - && !new RegExp(`${app.msgs.menuLabel_show} ${app.msgs.menuLabel_notifs}`, 'i').test(msg) |
430 | | - ) return |
431 | | - |
432 | | - // Strip state word to append colored one later |
433 | | - const foundState = toolbarMenu.state.words.find(word => msg.includes(word)) |
434 | | - if (foundState) msg = msg.replace(foundState, '') |
435 | | - |
436 | | - // Show notification |
437 | | - chatgpt.notify(`${app.symbol} ${msg}`, pos ||( config.notifBottom ? 'bottom' : '' ), |
438 | | - notifDuration, shadow || env.ui.scheme == 'light') |
439 | | - const notif = document.querySelector('.chatgpt-notif:last-child') |
440 | | - notif.classList.add(app.slug) // for styles.toast |
441 | | - |
442 | | - // Append styled state word |
443 | | - if (foundState) { |
444 | | - const stateStyles = { |
445 | | - on: { |
446 | | - light: 'color: #5cef48 ; text-shadow: rgba(255,250,169,0.38) 2px 1px 5px', |
447 | | - dark: 'color: #5cef48 ; text-shadow: rgb(55,255,0) 3px 0 10px' |
448 | | - }, |
449 | | - off: { |
450 | | - light: 'color: #ef4848 ; text-shadow: rgba(255,169,225,0.44) 2px 1px 5px', |
451 | | - dark: 'color: #ef4848 ; text-shadow: rgba(255, 116, 116, 0.87) 3px 0 9px' |
452 | | - } |
453 | | - } |
454 | | - const styledStateSpan = dom.create.elem('span') |
455 | | - styledStateSpan.style.cssText = stateStyles[ |
456 | | - foundState == toolbarMenu.state.words[0] ? 'off' : 'on'][env.ui.scheme] |
457 | | - styledStateSpan.append(foundState) ; notif.append(styledStateSpan) |
458 | | - } |
459 | | - } |
460 | | - |
461 | 425 | // Define UI functions |
462 | 426 |
|
463 | 427 | window.toggleMode = async (mode, state) => { |
|
608 | 572 | ) |
609 | 573 | sync.configToUI({ updatedKey: key }) |
610 | 574 | if (ctgKey == 'siteSettings' && env.site == key) // notify if setting of active site toggled |
611 | | - notify(`${app.name} 🧩 ${ |
| 575 | + feedback.notify(`${app.name} 🧩 ${ |
612 | 576 | app.msgs[`state_${config[`${key}Disabled`] ? 'off' : 'on' }`].toUpperCase()}`) |
613 | 577 | else if (ctgKey != 'siteSettings') |
614 | | - notify(`${entryData.label}: ${toolbarMenu.state.words[+settings.typeIsEnabled(key)]}`) |
| 578 | + feedback.notify(`${entryData.label}: ${toolbarMenu.state.words[+settings.typeIsEnabled(key)]}`) |
615 | 579 |
|
616 | 580 | // Enable/disable dependent entries |
617 | 581 | for (const [ctrlKey, ctrlData] of Object.entries( |
|
937 | 901 | if ((event.key == 'F11' || event.keyCode == 122) && !config.fullscreen) config.f11 = true |
938 | 902 | else if ((event.key.startsWith('Esc') || event.keyCode == 27) && chatgpt.isTyping()) |
939 | 903 | try { chatgpt.stop() ; requestAnimationFrame(() => !chatgpt.isTyping() && |
940 | | - notify(app.msgs.notif_chatStopped, 'bottom-right')) } catch (err) {} |
| 904 | + feedback.notify(app.msgs.notif_chatStopped, 'bottom-right')) } catch (err) {} |
941 | 905 | }) |
942 | 906 |
|
943 | 907 | })() |
0 commit comments