Skip to content

Commit 9a1256c

Browse files
committed
Moved env.browser.isMobile check to toggle.tooltip() to unconditionally make tooltipDiv to support use for future menus
1 parent 54bb498 commit 9a1256c

File tree

4 files changed

+65
-73
lines changed

4 files changed

+65
-73
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 16 additions & 18 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.2.4.6
6+
// @version 2025.2.4.7
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
@@ -2003,8 +2003,7 @@
20032003
get.reply(msgChain)
20042004

20052005
// Hide/remove elems
2006-
if (!env.browser.isMobile) // hide 'Send reply' tooltip post-send btn click
2007-
tooltipDiv.style.opacity = 0
2006+
tooltipDiv.style.opacity = 0 // hide chatbar button tooltips
20082007

20092008
// Show loading status
20102009
const replySection = appDiv.querySelector('section')
@@ -2296,7 +2295,7 @@
22962295
}
22972296
}
22982297
update.appBottomPos() // toggle visual minimization
2299-
if (!env.browser.isMobile) setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
2298+
setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
23002299
},
23012300

23022301
proxyMode() {
@@ -2349,6 +2348,7 @@
23492348
},
23502349

23512350
tooltip(event) {
2351+
if (env.browser.isMobile) return
23522352
if (event.type == 'mouseleave') { tooltipDiv.style.opacity = 0 ; return }
23532353

23542354
const btn = event.currentTarget, btnType = /[^-]+-([\w-]+)-btn/.exec(btn.id)[1],
@@ -3122,20 +3122,18 @@
31223122
document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
31233123

31243124
// Create/stylize TOOLTIPs
3125-
if (!env.browser.isMobile) {
3126-
var tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
3127-
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
3128-
+ 'background-color:' // bubble style
3129-
+ 'rgba(0,0,0,0.64) ; padding: 4px 6px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
3130-
+ 'font-size: 0.87em ; color: white ; fill: white ; stroke: white ;' // font/icon style
3131-
+ 'position: absolute ;' // for update.tooltip() calcs
3132-
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
3133-
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
3134-
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
3135-
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
3136-
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
3137-
))
3138-
}
3125+
const tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
3126+
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
3127+
+ 'background-color:' // bubble style
3128+
+ 'rgba(0,0,0,0.64) ; padding: 4px 6px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
3129+
+ 'font-size: 0.87em ; color: white ; fill: white ; stroke: white ;' // font/icon style
3130+
+ 'position: absolute ;' // for update.tooltip() calcs
3131+
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
3132+
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
3133+
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
3134+
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
3135+
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
3136+
))
31393137

31403138
// APPEND AMAZONGPT to Amazon
31413139
document.body.append(appDiv)

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 16 additions & 18 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.2.4.6
151+
// @version 2025.2.4.7
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
154154
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
@@ -2584,8 +2584,7 @@
25842584

25852585
// Hide/remove elems
25862586
appDiv.querySelector(`.${app.slug}-related-queries`)?.remove() // remove related queries
2587-
if (!env.browser.isMobile) // hide chatbar button tooltips
2588-
tooltipDiv.style.opacity = 0
2587+
tooltipDiv.style.opacity = 0 // hide chatbar button tooltips
25892588
appDiv.querySelector('footer').textContent = ''
25902589

25912590
// Show loading status
@@ -2940,7 +2939,7 @@
29402939
}
29412940
}
29422941
update.appBottomPos() // toggle visual minimization
2943-
if (!env.browser.isMobile) setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
2942+
setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
29442943
},
29452944

29462945
proxyMode() {
@@ -3031,6 +3030,7 @@
30313030
},
30323031

30333032
tooltip(event) {
3033+
if (env.browser.isMobile) return
30343034
if (event.type == 'mouseleave') { tooltipDiv.style.opacity = 0 ; return }
30353035

30363036
const btn = event.currentTarget, btnType = /[^-]+-([\w-]+)-btn/.exec(btn.id)[1],
@@ -3994,20 +3994,18 @@
39943994
document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
39953995

39963996
// Create/stylize TOOLTIPs
3997-
if (!env.browser.isMobile) {
3998-
var tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
3999-
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
4000-
+ 'background-color:' // bubble style
4001-
+ 'rgba(0,0,0,0.64) ; padding: 4px 6px 4px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
4002-
+ 'font-size: 0.58rem ; color: white ; fill: white ; stroke: white ;' // font/icon style
4003-
+ 'position: absolute ;' // for update.tooltip() calcs
4004-
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
4005-
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
4006-
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
4007-
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
4008-
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
4009-
))
4010-
}
3997+
const tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
3998+
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
3999+
+ 'background-color:' // bubble style
4000+
+ 'rgba(0,0,0,0.64) ; padding: 4px 6px 4px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
4001+
+ 'font-size: 0.58rem ; color: white ; fill: white ; stroke: white ;' // font/icon style
4002+
+ 'position: absolute ;' // for update.tooltip() calcs
4003+
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
4004+
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
4005+
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
4006+
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
4007+
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
4008+
))
40114009

40124010
// APPEND to Brave
40134011
const appDivParentSelector = env.browser.isMobile ? '#results' : '.sidebar'

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 17 additions & 20 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.2.4.5
151+
// @version 2025.2.4.6
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -2586,8 +2586,7 @@
25862586

25872587
// Hide/remove elems
25882588
appDiv.querySelector(`.${app.slug}-related-queries`)?.remove() // remove related queries
2589-
if (!env.browser.isMobile) // hide chatbar button tooltips
2590-
tooltipDiv.style.opacity = 0
2589+
tooltipDiv.style.opacity = 0 // hide chatbar button tooltips
25912590

25922591
// Show loading status
25932592
const replySection = appDiv.querySelector('section')
@@ -2943,7 +2942,7 @@
29432942
}
29442943
}
29452944
update.appBottomPos() // toggle visual minimization
2946-
if (!env.browser.isMobile) setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
2945+
setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
29472946
},
29482947

29492948
proxyMode() {
@@ -3034,6 +3033,7 @@
30343033
},
30353034

30363035
tooltip(event) {
3036+
if (env.browser.isMobile) return
30373037
if (event.type == 'mouseleave') { tooltipDiv.style.opacity = 0 ; return }
30383038

30393039
const btn = event.currentTarget, btnType = /[^-]+-([\w-]+)-btn/.exec(btn.id)[1],
@@ -3708,8 +3708,7 @@
37083708
},
37093709

37103710
reply(answer) {
3711-
if (!env.browser.isMobile) // hide lingering tooltip if cursor was on corner button
3712-
tooltipDiv.style.opacity = 0
3711+
tooltipDiv.style.opacity = 0 // hide lingering tooltip if cursor was on corner button
37133712

37143713
// Build answer interface up to reply section if missing
37153714
if (!appDiv.querySelector('pre')) {
@@ -3984,20 +3983,18 @@
39843983
document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
39853984

39863985
// Create/stylize TOOLTIPs
3987-
if (!env.browser.isMobile) {
3988-
var tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
3989-
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
3990-
+ 'background-color:' // bubble style
3991-
+ 'rgba(0,0,0,0.64) ; padding: 5px 6px 3px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
3992-
+ 'font-size: 0.87em ; color: white ; fill: white ; stroke: white ;' // font/icon style
3993-
+ 'position: absolute ;' // for update.tooltip() calcs
3994-
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
3995-
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
3996-
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
3997-
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
3998-
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
3999-
))
4000-
}
3986+
const tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
3987+
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
3988+
+ 'background-color:' // bubble style
3989+
+ 'rgba(0,0,0,0.64) ; padding: 5px 6px 3px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
3990+
+ 'font-size: 0.87em ; color: white ; fill: white ; stroke: white ;' // font/icon style
3991+
+ 'position: absolute ;' // for update.tooltip() calcs
3992+
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
3993+
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
3994+
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
3995+
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
3996+
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
3997+
))
40013998

40023999
// Create/classify/fill feedback FOOTER
40034000
const appFooter = dom.create.elem('footer', { class: 'fade-in anchored-hidden' })

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 16 additions & 17 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.2.4.6
152+
// @version 2025.2.4.7
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -2747,8 +2747,7 @@
27472747

27482748
// Hide/remove elems
27492749
appDiv.querySelector(`.${app.slug}-related-queries`)?.remove() // remove related queries
2750-
if (!env.browser.isMobile) // hide chatbar button tooltips
2751-
tooltipDiv.style.opacity = 0
2750+
tooltipDiv.style.opacity = 0 // hide chatbar button tooltips
27522751
appDiv.querySelector('footer').textContent = ''
27532752

27542753
// Show loading status
@@ -3111,7 +3110,7 @@
31113110
}
31123111
}
31133112
update.appBottomPos() // toggle visual minimization
3114-
if (!env.browser.isMobile) setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
3113+
setTimeout(() => tooltipDiv.style.opacity = 0, 1) // remove lingering tooltip
31153114
},
31163115

31173116
proxyMode() {
@@ -3203,6 +3202,7 @@
32033202
},
32043203

32053204
tooltip(event) {
3205+
if (env.browser.isMobile) return
32063206
if (event.type == 'mouseleave') { tooltipDiv.style.opacity = 0 ; return }
32073207

32083208
const btn = event.currentTarget, btnType = /[^-]+-([\w-]+)-btn/.exec(btn.id)[1],
@@ -4181,19 +4181,18 @@
41814181
document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
41824182

41834183
// Create/stylize TOOLTIPs
4184-
if (!env.browser.isMobile) {
4185-
var tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
4186-
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
4187-
+ 'background-color: rgba(0,0,0,0.64) ; padding: 6px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;' // bubble style
4188-
+ 'font-size: 0.75rem ; color: white ; fill: white ; stroke: white ;' // font/icon style
4189-
+ 'position: absolute ;' // for update.tooltip() calcs
4190-
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
4191-
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
4192-
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
4193-
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
4194-
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
4195-
))
4196-
}
4184+
const tooltipDiv = dom.create.elem('div', { class: `${app.slug}-btn-tooltip no-user-select` })
4185+
document.head.append(dom.create.style(`.${app.slug}-btn-tooltip {`
4186+
+ 'background-color:' // // bubble style
4187+
+ 'rgba(0,0,0,0.64) ; padding: 6px ; border-radius: 6px ; border: 1px solid #d9d9e3 ;'
4188+
+ 'font-size: 0.75rem ; color: white ; fill: white ; stroke: white ;' // font/icon style
4189+
+ 'position: absolute ;' // for update.tooltip() calcs
4190+
+ `--shadow: 3px 5px 16px 0 rgb(0,0,0,0.21) ;
4191+
box-shadow: var(--shadow) ; -webkit-box-shadow: var(--shadow) ; -moz-box-shadow: var(--shadow)`
4192+
+ 'opacity: 0 ; height: fit-content ; z-index: 1250 ;' // visibility
4193+
+ 'transition: opacity 0.1s ; -webkit-transition: opacity 0.1s ; -moz-transition: opacity 0.1s ;'
4194+
+ '-o-transition: opacity 0.1s ; -ms-transition: opacity 0.1s }'
4195+
))
41974196

41984197
// APPEND to Google
41994198
const centerCol = document.querySelector('#center_col') || document.querySelector('#main')

0 commit comments

Comments
 (0)