Skip to content

Commit ac534d2

Browse files
committed
Added hide tooltip on chatbar btn click, eliminated backtracking in regex, made Expand/Shrink btn update tooltip on click, removed unneeded delay from hide tooltip on Min/Max btn click
1 parent 4f3a345 commit ac534d2

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Adds the magic of AI to Amazon shopping
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.3.31.5
6+
// @version 2025.3.31.6
77
// @license MIT
88
// @icon https://cdn.jsdelivr.net/gh/KudoAI/amazongpt@0fddfc7/assets/images/icons/amazongpt/black-gold-teal/icon48.png
99
// @icon64 https://cdn.jsdelivr.net/gh/KudoAI/amazongpt@0fddfc7/assets/images/icons/amazongpt/black-gold-teal/icon64.png
@@ -2178,6 +2178,7 @@
21782178
// Add button listeners
21792179
appDiv.querySelectorAll(`.${app.slug}-chatbar-btn`).forEach(btn =>{
21802180
btn.onclick = () => {
2181+
tooltip.toggle('off') // hide lingering tooltip when not in Standby mode
21812182
const btnType = /-(\w+)-btn$/.exec(btn.id)[1]
21822183
if (btnType == 'send') return // since handled by form submit
21832184
show.reply.src = btnType
@@ -2323,7 +2324,7 @@
23232324
if (!tooltip.div.isConnected) appDiv.append(tooltip.div)
23242325
if (!tooltip.styles) tooltip.stylize()
23252326
if (typeof stateOrEvent == 'object') // mouse event from btn hover, update text/pos
2326-
tooltip.update(/[^-]+-([\w-]+)-btn/.exec(stateOrEvent.currentTarget.id)[1])
2327+
tooltip.update(new RegExp(`${app.slug}-([\\w-]+)-btn`).exec(stateOrEvent.currentTarget.id)[1])
23272328
tooltip.div.style.opacity = +( stateOrEvent?.type == 'mouseenter' || stateOrEvent == 'on' )
23282329
},
23292330

@@ -2522,7 +2523,7 @@
25222523
update.bylineVisibility() ; appDiv.removeEventListener('transitionend', onTransitionEnd)
25232524
}})
25242525
if (config.minimized) toggle.minimized('off') // since user wants to see stuff
2525-
icons.arrowsDiagonal.update() ; tooltip.toggle('off') // update icon/tooltip
2526+
icons.arrowsDiagonal.update() ; tooltip.update('arrows') // update icon/tooltip
25262527
},
25272528

25282529
minimized(state = '') {
@@ -2539,7 +2540,7 @@
25392540
}
25402541
}
25412542
update.appBottomPos() // toggle visual minimization
2542-
setTimeout(() => tooltip.toggle('off'), 1) // remove lingering tooltip
2543+
tooltip.toggle('off') // hide lingering tooltip
25432544
},
25442545

25452546
proxyMode() {

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.3.31.8
151+
// @version 2025.3.31.9
152152
// @license MIT
153153
// @icon https://cdn.jsdelivr.net/gh/KudoAI/bravegpt@df624b0/assets/images/icons/bravegpt/icon48.png
154154
// @icon64 https://cdn.jsdelivr.net/gh/KudoAI/bravegpt@df624b0/assets/images/icons/bravegpt/icon64.png
@@ -2813,6 +2813,7 @@
28132813
// Add button listeners
28142814
appDiv.querySelectorAll(`.${app.slug}-chatbar-btn`).forEach(btn =>{
28152815
btn.onclick = () => {
2816+
tooltip.toggle('off') // hide lingering tooltip when not in Standby mode
28162817
const btnType = /-(\w+)-btn$/.exec(btn.id)[1]
28172818
if (btnType == 'send') return // since handled by form submit
28182819
show.reply.src = btnType
@@ -2959,7 +2960,7 @@
29592960
if (!tooltip.div.isConnected) appDiv.append(tooltip.div)
29602961
if (!tooltip.styles) tooltip.stylize()
29612962
if (typeof stateOrEvent == 'object') // mouse event from btn hover, update text/pos
2962-
tooltip.update(/[^-]+-([\w-]+)-btn/.exec(stateOrEvent.currentTarget.id)[1])
2963+
tooltip.update(new RegExp(`${app.slug}-([\\w-]+)-btn`).exec(stateOrEvent.currentTarget.id)[1])
29632964
tooltip.div.style.opacity = +( stateOrEvent?.type == 'mouseenter' || stateOrEvent == 'on' )
29642965
},
29652966

@@ -3240,7 +3241,7 @@
32403241
if (event.propertyName == 'width') {
32413242
update.bylineVisibility() ; appDiv.removeEventListener('transitionend', onTransitionEnd)
32423243
}})
3243-
icons.arrowsDiagonal.update() ; tooltip.toggle('off') // update icon/tooltip
3244+
icons.arrowsDiagonal.update() ; tooltip.update('arrows') // update icon/tooltip
32443245
},
32453246

32463247
manualGen(mode) { // Prefix/Suffix modes
@@ -3274,7 +3275,7 @@
32743275
}
32753276
}
32763277
update.appBottomPos() // toggle visual minimization
3277-
setTimeout(() => tooltip.toggle('off'), 1) // remove lingering tooltip
3278+
tooltip.toggle('off') // hide lingering tooltip
32783279
},
32793280

32803281
proxyMode() {

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.3.31.7
151+
// @version 2025.3.31.8
152152
// @license MIT
153153
// @icon https://cdn.jsdelivr.net/gh/KudoAI/duckduckgpt@06af076/assets/images/icons/duckduckgpt/icon48.png
154154
// @icon64 https://cdn.jsdelivr.net/gh/KudoAI/duckduckgpt@06af076/assets/images/icons/duckduckgpt/icon64.png
@@ -2821,6 +2821,7 @@
28212821
// Add button listeners
28222822
appDiv.querySelectorAll(`.${app.slug}-chatbar-btn`).forEach(btn =>{
28232823
btn.onclick = () => {
2824+
tooltip.toggle('off') // hide lingering tooltip when not in Standby mode
28242825
const btnType = /-(\w+)-btn$/.exec(btn.id)[1]
28252826
if (btnType == 'send') return // since handled by form submit
28262827
show.reply.src = btnType
@@ -2968,7 +2969,7 @@
29682969
if (!tooltip.div.isConnected) appDiv.append(tooltip.div)
29692970
if (!tooltip.styles) tooltip.stylize()
29702971
if (typeof stateOrEvent == 'object') // mouse event from btn hover, update text/pos
2971-
tooltip.update(/[^-]+-([\w-]+)-btn/.exec(stateOrEvent.currentTarget.id)[1])
2972+
tooltip.update(new RegExp(`${app.slug}-([\\w-]+)-btn`).exec(stateOrEvent.currentTarget.id)[1])
29722973
tooltip.div.style.opacity = +( stateOrEvent?.type == 'mouseenter' || stateOrEvent == 'on' )
29732974
},
29742975

@@ -3241,7 +3242,7 @@
32413242
if (event.propertyName == 'width') {
32423243
update.bylineVisibility() ; appDiv.removeEventListener('transitionend', onTransitionEnd)
32433244
}})
3244-
icons.arrowsDiagonal.update() ; tooltip.toggle('off') // update icon/tooltip
3245+
icons.arrowsDiagonal.update() ; tooltip.update('arrows') // update icon/tooltip
32453246
},
32463247

32473248
manualGen(mode) { // Prefix/Suffix modes
@@ -3273,7 +3274,7 @@
32733274
}
32743275
}
32753276
update.appBottomPos() // toggle visual minimization
3276-
setTimeout(() => tooltip.toggle('off'), 1) // remove lingering tooltip
3277+
tooltip.toggle('off') // hide lingering tooltip
32773278
},
32783279

32793280
proxyMode() {

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.3.31.7
152+
// @version 2025.3.31.8
153153
// @license MIT
154154
// @icon https://cdn.jsdelivr.net/gh/KudoAI/googlegpt@59409b2/assets/images/icons/googlegpt/black/icon48.png
155155
// @icon64 https://cdn.jsdelivr.net/gh/KudoAI/googlegpt@59409b2/assets/images/icons/googlegpt/black/icon64.png
@@ -2994,6 +2994,7 @@
29942994
// Add button listeners
29952995
appDiv.querySelectorAll(`.${app.slug}-chatbar-btn`).forEach(btn =>{
29962996
btn.onclick = () => {
2997+
tooltip.toggle('off') // hide lingering tooltip when not in Standby mode
29972998
const btnType = /-(\w+)-btn$/.exec(btn.id)[1]
29982999
if (btnType == 'send') return // since handled by form submit
29993000
show.reply.src = btnType
@@ -3141,7 +3142,7 @@
31413142
if (!tooltip.div.isConnected) appDiv.append(tooltip.div)
31423143
if (!tooltip.styles) tooltip.stylize()
31433144
if (typeof stateOrEvent == 'object') // mouse event from btn hover, update text/pos
3144-
tooltip.update(/[^-]+-([\w-]+)-btn/.exec(stateOrEvent.currentTarget.id)[1])
3145+
tooltip.update(new RegExp(`${app.slug}-([\\w-]+)-btn`).exec(stateOrEvent.currentTarget.id)[1])
31453146
tooltip.div.style.opacity = +( stateOrEvent?.type == 'mouseenter' || stateOrEvent == 'on' )
31463147
},
31473148

@@ -3419,7 +3420,7 @@
34193420
if (event.propertyName == 'width') {
34203421
update.bylineVisibility() ; appDiv.removeEventListener('transitionend', onTransitionEnd)
34213422
}})
3422-
icons.arrowsDiagonal.update() ; tooltip.toggle('off') // update icon/tooltip
3423+
icons.arrowsDiagonal.update() ; tooltip.update('arrows') // update icon/tooltip
34233424
},
34243425

34253426
manualGen(mode) { // Prefix/Suffix modes
@@ -3451,7 +3452,7 @@
34513452
}
34523453
}
34533454
update.appBottomPos() // toggle visual minimization
3454-
setTimeout(() => tooltip.toggle('off'), 1) // remove lingering tooltip
3455+
tooltip.toggle('off') // hide lingering tooltip
34553456
},
34563457

34573458
proxyMode() {

0 commit comments

Comments
 (0)