|
148 | 148 | // @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (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.bravegpt.com/images/icons/app/icon48.png?v=e8ca7c2 |
154 | 154 | // @icon64 https://assets.bravegpt.com/images/icons/app/icon64.png?v=e8ca7c2 |
|
200 | 200 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@f7e2f2d/assets/js/components/chatbot/buttons.js#sha256-Srg5wWTmP3Zv2OkTLEHeX7HKeKjeYnRgdIFhdRJMuik= |
201 | 201 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@0329ace/assets/js/components/chatbot/icons.js#sha256-p89CrELJj8rguE8M4IjdMA4CYwX7iid+RNzvX3oOT2A= |
202 | 202 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@bfdb063/assets/js/components/chatbot/menus.js#sha256-ZOZBraa/OmK/AKDtJucT9+i5uuq3suasT3kjJl0UBdA= |
203 | | -// @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@97173cc/assets/js/components/chatbot/replyBubble.js#sha256-sOVj/ESmlNMLCA13w2ZzqP5hVtcnqlQpbY9yvkFWNek= |
| 203 | +// @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@1dfd40d/assets/js/components/chatbot/replyBubble.js#sha256-VsTgaqE8IrQP7ywc7KE9OGL63uLfEO8DdwK2po6CXas= |
204 | 204 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@6fd9b53/assets/js/components/chatbot/tooltip.js#sha256-RbmcNuh/DiKIH+Ch2KYrIo48pLAUd/445leqYwBGEXw= |
205 | 205 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@bb5451a/assets/js/lib/chatbot/api.js#sha256-nCFc1tcSAfGJT260Sn07YGEczKPrhXdj8UlrKi+ac8M= |
206 | 206 | // @require https://cdn.jsdelivr.net/gh/adamlui/ai-web-extensions@ecaeb55/assets/js/lib/chatbot/feedback.js#sha256-9Hm3fBS96DtWFdT5VwGDGvwZMpYIRfxGAQRaCGECeqA= |
|
532 | 532 |
|
533 | 533 | window.update = { |
534 | 534 |
|
535 | | - replyPreMaxHeight() { // for various mode toggles |
536 | | - const replyPre = app.div.querySelector('.reply-pre'), |
537 | | - relatedQueries = app.div.querySelector(`.${app.slug}-related-queries`), |
538 | | - shorterPreHeight = innerHeight - relatedQueries?.offsetHeight - 304, |
539 | | - longerPreHeight = innerHeight - 278 |
540 | | - if (replyPre) replyPre.style.maxHeight = ( |
541 | | - config.stickySidebar ? ( |
542 | | - relatedQueries?.offsetHeight > 0 ? `${shorterPreHeight}px` : `${longerPreHeight}px` ) |
543 | | - : config.anchored ? `${ longerPreHeight - ( config.expanded ? 115 : 365 ) }px` : 'none' |
544 | | - ) |
545 | | - }, |
546 | | - |
547 | 535 | appBottomPos() { app.div.style.bottom = `${ config.minimized ? 48 - app.div.offsetHeight : -32 }px` }, |
548 | 536 |
|
549 | 537 | appStyle() { // used in toggle.animations() + update.scheme() + main's app init |
|
1123 | 1111 |
|
1124 | 1112 | // Apply changed state to UI |
1125 | 1113 | app.div.classList.toggle('anchored', config.anchored) |
1126 | | - update.rqVisibility() ; update.replyPreMaxHeight() ; update.bylineVisibility() |
| 1114 | + update.rqVisibility() ; replyBubble.updateMaxHeight() ; update.bylineVisibility() |
1127 | 1115 | if (modals.settings.get()) { // update visual state of Settings toggle |
1128 | 1116 | const anchorToggle = document.querySelector('[id*=anchor] input') |
1129 | 1117 | if (anchorToggle.checked != config.anchored) modals.settings.toggle.switch(anchorToggle) |
|
1244 | 1232 | get.related(app.msgChain[app.msgChain.length - 1]?.content || searchQuery) |
1245 | 1233 | .then(queries => show.related(queries)) |
1246 | 1234 | .catch(err => { log.error(err.message) ; api.tryNew(get.related) }) |
1247 | | - update.replyPreMaxHeight() |
| 1235 | + replyBubble.updateMaxHeight() |
1248 | 1236 | feedback.notify(`${app.msgs.menuLabel_relatedQueries} ${menus.toolbar.state.words[+!config.rqDisabled]}`) |
1249 | 1237 | }, |
1250 | 1238 |
|
|
1261 | 1249 |
|
1262 | 1250 | // Apply new state to UI |
1263 | 1251 | app.div.classList.toggle(mode, config[configKeyName]) |
1264 | | - update.replyPreMaxHeight() ; update.bylineVisibility() |
| 1252 | + replyBubble.updateMaxHeight() ; update.bylineVisibility() |
1265 | 1253 | if (mode == 'wider') // toggle icons everywhere |
1266 | 1254 | document.querySelectorAll(`#${app.slug} svg.widescreenTall, #${app.slug} svg.widescreenWide`) |
1267 | 1255 | .forEach(icon => icon.replaceWith( |
|
1603 | 1591 | }, (idx+1) *50) |
1604 | 1592 | }) |
1605 | 1593 |
|
1606 | | - update.replyPreMaxHeight() ; get.related.replyIsQuestion = null |
| 1594 | + replyBubble.updateMaxHeight() ; get.related.replyIsQuestion = null |
1607 | 1595 | } |
1608 | 1596 | }, |
1609 | 1597 |
|
|
1813 | 1801 | ;[replyPre, ...replyPre.querySelectorAll('*')].forEach(elem => |
1814 | 1802 | renderMathInElement(elem, { delimiters: app.katexDelimiters, throwOnError: false })) |
1815 | 1803 |
|
1816 | | - if (config.stickySidebar) update.replyPreMaxHeight() |
| 1804 | + if (config.stickySidebar) replyBubble.updateMaxHeight() |
1817 | 1805 | saveAppDiv() // to fight Brave mutations |
1818 | 1806 |
|
1819 | 1807 | // Auto-scroll if active |
|
0 commit comments