Skip to content

Commit 3fe2c65

Browse files
committed
Moved semicolons to left of leading arrays for easier maintenance
1 parent 9a9ffdc commit 3fe2c65

File tree

13 files changed

+163
-173
lines changed

13 files changed

+163
-173
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.5.9
6+
// @version 2025.5.9.1
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c
@@ -124,8 +124,7 @@
124124
name: (() => { try { return GM_info.scriptHandler } catch (err) { return 'unknown' }})(),
125125
version: (() => { try { return GM_info.version } catch (err) { return 'unknown' }})()
126126
}
127-
};
128-
['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform =>
127+
} ; ['Chromium', 'Firefox', 'Chrome', 'Edge', 'Brave', 'Mobile'].forEach(platform =>
129128
env.browser[`is${ platform == 'Firefox' ? 'FF' : platform }`] = chatgpt.browser['is' + platform]())
130129
env.browser.isPortrait = env.browser.isMobile && ( innerWidth < innerHeight )
131130
env.browser.isPhone = env.browser.isMobile && innerWidth <= 480
@@ -466,10 +465,10 @@
466465
+ settings.controls.proxyAPIenabled.label + ' '
467466
+ this.state.separator + this.state.words[+config.proxyAPIenabled]
468467
this.entryIDs = [GM_registerMenuCommand(pmLabel, toggle.proxyMode,
469-
env.scriptManager.supportsTooltips ? { title: settings.controls.proxyAPIenabled.helptip } : undefined)];
468+
env.scriptManager.supportsTooltips ? { title: settings.controls.proxyAPIenabled.helptip } : undefined)]
470469

471470
// Add About/Settings entries
472-
['about', 'settings'].forEach(entryType => this.entryIDs.push(GM_registerMenuCommand(
471+
;['about', 'settings'].forEach(entryType => this.entryIDs.push(GM_registerMenuCommand(
473472
entryType == 'about' ? `💡 ${settings.controls.about.label}` : `⚙️ ${app.msgs.menuLabel_settings}`,
474473
() => modals.open(entryType), env.scriptManager.supportsTooltips ? { title: ' ' } : undefined
475474
)))
@@ -750,10 +749,10 @@
750749
transition: '0.1s', '-webkit-transition': '0.1s', '-moz-transition': '0.1s',
751750
'-o-transition': '0.1s', '-ms-transition': '0.1s'
752751
})
753-
document.body.style.cursor = 'grabbing'; // update cursor
754-
[...modals.draggingModal.children] // prevent hover FX if drag lags behind cursor
755-
.forEach(child => child.style.pointerEvents = 'none');
756-
['mousemove', 'mouseup'].forEach(eventType => // add listeners
752+
document.body.style.cursor = 'grabbing' // update cursor
753+
;[...modals.draggingModal.children] // prevent hover FX if drag lags behind cursor
754+
.forEach(child => child.style.pointerEvents = 'none')
755+
;['mousemove', 'mouseup'].forEach(eventType => // add listeners
757756
document.addEventListener(eventType, modals.handlers.drag[eventType]))
758757
const draggingModalRect = modals.draggingModal.getBoundingClientRect()
759758
modals.handlers.drag.offsetX = event.clientX - draggingModalRect.left +21
@@ -774,10 +773,10 @@
774773
transition: 'inherit', '-webkit-transition': 'inherit', '-moz-transition': 'inherit',
775774
'-o-transition': 'inherit', '-ms-transition': 'inherit'
776775
})
777-
document.body.style.cursor = ''; // restore cursor
778-
[...modals.draggingModal.children] // restore pointer events
779-
.forEach(child => child.style.pointerEvents = '');
780-
['mousemove', 'mouseup'].forEach(eventType => // remove listeners
776+
document.body.style.cursor = '' // restore cursor
777+
;[...modals.draggingModal.children] // restore pointer events
778+
.forEach(child => child.style.pointerEvents = '')
779+
;['mousemove', 'mouseup'].forEach(eventType => // remove listeners
781780
document.removeEventListener(eventType, modals.handlers.drag[eventType]))
782781
modals.draggingModal = null
783782
}
@@ -3304,8 +3303,8 @@
33043303
const downloadBtn = dom.create.elem('btn', { id: `${app.slug}-download-btn` }),
33053304
downloadSVGs = { download: icons.download.create(), downloaded: icons.checkmarkDouble.create() }
33063305
Object.entries(downloadSVGs).forEach(([svgType, svg]) => {
3307-
svg.id = `${app.slug}-${svgType}-icon`;
3308-
['width', 'height'].forEach(attr => svg.setAttribute(attr, 15))
3306+
svg.id = `${app.slug}-${svgType}-icon`
3307+
;['width', 'height'].forEach(attr => svg.setAttribute(attr, 15))
33093308
})
33103309
downloadBtn.append(downloadSVGs.download)
33113310
downloadBtn.onclick = event => { // download code, update icon + tooltip status
@@ -3446,10 +3445,10 @@
34463445
id: `${app.slug}-chatbar`, rows: 1, placeholder: `${app.msgs.tooltip_sendReply}...` })
34473446
continueChatDiv.append(chatTextarea)
34483447
replyForm.append(continueChatDiv) ; replySection.append(replyForm)
3449-
appDiv.querySelector('.reply-bubble').after(replySection);
3448+
appDiv.querySelector('.reply-bubble').after(replySection)
34503449

34513450
// Create/append chatbar buttons
3452-
['send', 'shuffle'].forEach(btnType => {
3451+
;['send', 'shuffle'].forEach(btnType => {
34533452
const btn = dom.create.elem('button', {
34543453
id: `${app.slug}-${btnType}-btn`, class: `${app.slug}-chatbar-btn no-mobile-tap-outline` })
34553454
btn.style.right = `${ btnType == 'send' ? ( env.browser.isFF ? 12 : 9 )
@@ -3495,10 +3494,10 @@
34953494
hljs.highlightAll() // highlight code
34963495
replyPre.querySelectorAll('code').forEach(codeBlock => // add linebreaks after semicolons
34973496
codeBlock.innerHTML = codeBlock.innerHTML.replace(/;\s*/g, ';<br>'))
3498-
update.replyPrefix(); // prepend '>> ' if dark scheme w/ bg animations to emulate terminal
3497+
update.replyPrefix() // prepend '>> ' if dark scheme w/ bg animations to emulate terminal
34993498

35003499
// Typeset math
3501-
[replyPre, ...replyPre.querySelectorAll('*')].forEach(elem =>
3500+
;[replyPre, ...replyPre.querySelectorAll('*')].forEach(elem =>
35023501
renderMathInElement(elem, { delimiters: katexDelimiters, throwOnError: false }))
35033502

35043503
// Auto-scroll if active
@@ -3547,8 +3546,8 @@
35473546
})
35483547
const copySVGs = { copy: icons.copy.create(), copied: icons.checkmarkDouble.create() }
35493548
Object.entries(copySVGs).forEach(([svgType, svg]) => {
3550-
svg.id = `${app.slug}-${svgType}-icon`;
3551-
['width', 'height'].forEach(attr => svg.setAttribute(attr, 15))
3549+
svg.id = `${app.slug}-${svgType}-icon`
3550+
;['width', 'height'].forEach(attr => svg.setAttribute(attr, 15))
35523551
})
35533552
this.copy.append(copySVGs.copy)
35543553
this.copy.listeners = {}
@@ -3581,8 +3580,8 @@
35813580
id: `${app.slug}-share-btn`, class: 'no-mobile-tap-outline',
35823581
style: this.styles + 'margin-right: 10px'
35833582
})
3584-
const shareSVG = icons.arrowShare.create();
3585-
['width', 'height'].forEach(attr => shareSVG.setAttribute(attr, 16))
3583+
const shareSVG = icons.arrowShare.create()
3584+
;['width', 'height'].forEach(attr => shareSVG.setAttribute(attr, 16))
35863585
this.share.append(shareSVG)
35873586
if (!env.browser.isMobile) this.share.onmouseenter = this.share.onmouseleave = tooltip.toggle
35883587
this.share.onclick = event => {
@@ -3609,8 +3608,8 @@
36093608
})
36103609
const regenSVGwrapper = dom.create.elem('div', { // to spin while respecting ini icon tilt
36113610
style: 'display: flex' }) // wrap the icon tightly
3612-
const regenSVG = icons.arrowsCyclic.create();
3613-
['width', 'height'].forEach(attr => regenSVG.setAttribute(attr, 14))
3611+
const regenSVG = icons.arrowsCyclic.create()
3612+
;['width', 'height'].forEach(attr => regenSVG.setAttribute(attr, 14))
36143613
regenSVGwrapper.append(regenSVG) ; this.regen.append(regenSVGwrapper)
36153614
if (!env.browser.isMobile) this.regen.onmouseenter = this.regen.onmouseleave = tooltip.toggle
36163615
this.regen.onclick = event => {
@@ -3632,8 +3631,8 @@
36323631
const speakSVGscroller = dom.create.elem('div', { // to scroll the icons
36333632
style: `display: flex ; /* align the SVGs horizontally */
36343633
width: 41px ; height: 22px /* rectangle to fit both icons */` })
3635-
const speakSVGs = { speak: icons.soundwave.create() } ; speakSVGs.speak.id = `${app.slug}-speak-icon`;
3636-
['generating', 'playing'].forEach(state => {
3634+
const speakSVGs = { speak: icons.soundwave.create() } ; speakSVGs.speak.id = `${app.slug}-speak-icon`
3635+
;['generating', 'playing'].forEach(state => {
36373636
speakSVGs[state] = []
36383637
for (let i = 0 ; i < 2 ; i++) { // push/id 2 of each state icon for continuous scroll animation
36393638
speakSVGs[state].push(
@@ -3759,8 +3758,8 @@
37593758
// Create/ID/classify/listenerize/stylize APP container
37603759
const appDiv = dom.create.elem('div', { id: app.slug, class: 'anchored fade-in' })
37613760
addListeners.appDiv() ; if (config.expanded) appDiv.classList.add('expanded')
3762-
document.head.append(app.styles = dom.create.style()) ; update.appStyle();
3763-
['rpg', 'rpw'].forEach(cssType => // rising particles
3761+
document.head.append(app.styles = dom.create.style()) ; update.appStyle()
3762+
;['rpg', 'rpw'].forEach(cssType => // rising particles
37643763
document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
37653764

37663765
// Hide GF alert on GitHub if found

assets/lib/dom.js/src/dom.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ window.dom = {
1111
particlesDivsWrapper.style.cssText = (
1212
'position: absolute ; top: 0 ; left: 0 ;' // hug targetNode's top-left corner
1313
+ 'height: 100% ; width: 100% ; border-radius: 15px ; overflow: clip ;' // bound innards exactly by targetNode
14-
+ 'z-index: -1' ); // allow interactive elems to be clicked
15-
['sm', 'med', 'lg'].forEach(particleSize => {
14+
+ 'z-index: -1' ) // allow interactive elems to be clicked
15+
;['sm', 'med', 'lg'].forEach(particleSize => {
1616
const particlesDiv = document.createElement('div')
1717
particlesDiv.id = config?.bgAnimationsDisabled ? `particles-${particleSize}-off`
1818
: `${( env?.ui?.scheme || env?.ui?.app?.scheme ) == 'dark' ? darkScheme

autoclear-chatgpt-history/greasemonkey/autoclear-chatgpt-history.user.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
226226
// @author Adam Lui
227227
// @namespace https://github.com/adamlui
228-
// @version 2025.5.9
228+
// @version 2025.5.9.1
229229
// @license MIT
230230
// @icon https://assets.autoclearchatgpt.com/images/icons/openai/black/icon48.png?v=f461c06
231231
// @icon64 https://assets.autoclearchatgpt.com/images/icons/openai/black/icon64.png?v=f461c06
@@ -442,10 +442,10 @@
442442
} else // Clear Now action
443443
clearChatsAndGoHome()
444444
}, env.scriptManager.supportsTooltips ? { title: ctrl.helptip || ' ' } : undefined)
445-
});
445+
})
446446

447447
// Add About/Donate entries
448-
['about', 'donate'].forEach(entryType => this.entryIDs.push(GM_registerMenuCommand(
448+
;['about', 'donate'].forEach(entryType => this.entryIDs.push(GM_registerMenuCommand(
449449
`${ entryType == 'about' ? '💡' : '💖' } ${
450450
app.msgs[`menuLabel_${entryType}`]} ${ entryType == 'about' ? app.msgs.appName : '' }`,
451451
() => entryType == 'about' ? modals.open(entryType) : modals.safeWinOpen(app.urls.donate['ko-fi']),
@@ -942,11 +942,9 @@
942942

943943
toolbarMenu.register() // create browser toolbar menu
944944
toggles.sidebar.update.navicon({ preload: true }) // preload sidebar NAVICON variants
945-
await Promise.race([chatgpt.isLoaded(), new Promise(resolve => setTimeout(resolve, 5000))]); // initial UI loaded
946-
947-
// Add RISING PARTICLES styles
948-
['rpg', 'rpw'].forEach(cssType => document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
949-
945+
await Promise.race([chatgpt.isLoaded(), new Promise(resolve => setTimeout(resolve, 5000))]) // initial UI loaded
946+
;['rpg', 'rpw'].forEach(cssType => // add Rising Particles styles
947+
document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
950948
toggles.sidebar.insert()
951949

952950
// AUTO-CLEAR on first visit if enabled

0 commit comments

Comments
 (0)