|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!) |
149 | 149 | // @author KudoAI |
150 | 150 | // @namespace https://kudoai.com |
151 | | -// @version 2025.9.6 |
| 151 | +// @version 2025.9.6.1 |
152 | 152 | // @license MIT |
153 | 153 | // @icon https://assets.ddgpt.com/images/icons/app/icon48.png?v=533ce0f |
154 | 154 | // @icon64 https://assets.ddgpt.com/images/icons/app/icon64.png?v=533ce0f |
|
201 | 201 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@f7e2f2d/assets/js/components/chatbot/buttons.js#sha256-Srg5wWTmP3Zv2OkTLEHeX7HKeKjeYnRgdIFhdRJMuik= |
202 | 202 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@0329ace/assets/js/components/chatbot/icons.js#sha256-p89CrELJj8rguE8M4IjdMA4CYwX7iid+RNzvX3oOT2A= |
203 | 203 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@bfdb063/assets/js/components/chatbot/menus.js#sha256-ZOZBraa/OmK/AKDtJucT9+i5uuq3suasT3kjJl0UBdA= |
204 | | -// @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@97173cc/assets/js/components/chatbot/replyBubble.js#sha256-sOVj/ESmlNMLCA13w2ZzqP5hVtcnqlQpbY9yvkFWNek= |
| 204 | +// @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@1dfd40d/assets/js/components/chatbot/replyBubble.js#sha256-VsTgaqE8IrQP7ywc7KE9OGL63uLfEO8DdwK2po6CXas= |
205 | 205 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@6fd9b53/assets/js/components/chatbot/tooltip.js#sha256-RbmcNuh/DiKIH+Ch2KYrIo48pLAUd/445leqYwBGEXw= |
206 | 206 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@bb5451a/assets/js/lib/chatbot/api.js#sha256-nCFc1tcSAfGJT260Sn07YGEczKPrhXdj8UlrKi+ac8M= |
207 | 207 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@ecaeb55/assets/js/lib/chatbot/feedback.js#sha256-9Hm3fBS96DtWFdT5VwGDGvwZMpYIRfxGAQRaCGECeqA= |
|
535 | 535 |
|
536 | 536 | window.update = { |
537 | 537 |
|
538 | | - replyPreMaxHeight() { // for various mode toggles |
539 | | - const replyPre = app.div.querySelector('.reply-pre'), |
540 | | - relatedQueries = app.div.querySelector(`.${app.slug}-related-queries`), |
541 | | - shorterPreHeight = innerHeight - relatedQueries?.offsetHeight - 245, |
542 | | - longerPreHeight = innerHeight - 255 |
543 | | - if (replyPre) replyPre.style.maxHeight = ( |
544 | | - config.stickySidebar ? ( |
545 | | - relatedQueries?.offsetHeight > 0 ? `${shorterPreHeight}px` : `${longerPreHeight}px` ) |
546 | | - : config.anchored ? `${ longerPreHeight - ( config.expanded ? 115 : 365 ) }px` : 'none' |
547 | | - ) |
548 | | - }, |
549 | | - |
550 | 538 | appBottomPos() { app.div.style.bottom = `${ config.minimized ? 61 - app.div.offsetHeight : -7 }px` }, |
551 | 539 |
|
552 | 540 | appStyle() { // used in toggle.animations() + update.scheme() + main's app init |
|
1135 | 1123 |
|
1136 | 1124 | // Apply changed state to UI |
1137 | 1125 | app.div.classList.toggle('anchored', config.anchored) |
1138 | | - update.rqVisibility() ; update.replyPreMaxHeight() ; update.bylineVisibility() ; update.chatbarWidth() |
| 1126 | + update.rqVisibility() ; replyBubble.updateMaxHeight() ; update.bylineVisibility() ; update.chatbarWidth() |
1139 | 1127 | if (modals.settings.get()) { // update visual state of Settings toggle |
1140 | 1128 | const anchorToggle = document.querySelector('[id*=anchor] input') |
1141 | 1129 | if (anchorToggle.checked != config.anchored) modals.settings.toggle.switch(anchorToggle) |
|
1254 | 1242 | get.related(app.msgChain[app.msgChain.length - 1]?.content || searchQuery) |
1255 | 1243 | .then(queries => show.related(queries)) |
1256 | 1244 | .catch(err => { log.error(err.message) ; api.tryNew(get.related) }) |
1257 | | - update.replyPreMaxHeight() |
| 1245 | + replyBubble.updateMaxHeight() |
1258 | 1246 | feedback.notify(`${app.msgs.menuLabel_relatedQueries} ${menus.toolbar.state.words[+!config.rqDisabled]}`) |
1259 | 1247 | }, |
1260 | 1248 |
|
|
1271 | 1259 |
|
1272 | 1260 | // Apply new state to UI |
1273 | 1261 | app.div.classList.toggle(mode, config[configKeyName]) |
1274 | | - update.replyPreMaxHeight() ; update.bylineVisibility() ; update.chatbarWidth() |
| 1262 | + replyBubble.updateMaxHeight() ; update.bylineVisibility() ; update.chatbarWidth() |
1275 | 1263 | if (mode == 'wider') // toggle icons everywhere |
1276 | 1264 | document.querySelectorAll(`#${app.slug} svg.widescreenTall, #${app.slug} svg.widescreenWide`) |
1277 | 1265 | .forEach(icon => icon.replaceWith( |
|
1610 | 1598 | }, (idx+1) *50) |
1611 | 1599 | }) |
1612 | 1600 |
|
1613 | | - update.replyPreMaxHeight() ; get.related.replyIsQuestion = null |
| 1601 | + replyBubble.updateMaxHeight() ; get.related.replyIsQuestion = null |
1614 | 1602 | } |
1615 | 1603 | }, |
1616 | 1604 |
|
|
1814 | 1802 | ;[replyPre, ...replyPre.querySelectorAll('*')].forEach(elem => |
1815 | 1803 | renderMathInElement(elem, { delimiters: app.katexDelimiters, throwOnError: false })) |
1816 | 1804 |
|
1817 | | - if (config.stickySidebar) update.replyPreMaxHeight() |
| 1805 | + if (config.stickySidebar) replyBubble.updateMaxHeight() |
1818 | 1806 |
|
1819 | 1807 | // Auto-scroll if active |
1820 | 1808 | if (config.autoScroll && !env.browser.isMobile && config.proxyAPIenabled && !config.streamingDisabled) { |
|
0 commit comments