Skip to content

Commit

Permalink
Updated rising-stars func/var/meta names + paths + comments ↞ [auto-s…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Jan 30, 2025
1 parent 9646af1 commit d27ed79
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 41 deletions.
6 changes: 3 additions & 3 deletions chromium/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ window.modals = {
alert(title = '', msg = '', btns = '', checkbox = '', width = '') { // generic one from chatgpt.alert()
const alertID = chatgpt.alert(title, msg, btns, checkbox, width),
alert = document.getElementById(alertID).firstChild
this.init(alert) // add classes + starry bg
this.init(alert) // add classes + rising particles bg
return alert
},

open(modalType, modalSubType) {
const modal = modalSubType ? this[modalType][modalSubType]() : this[modalType]() // show modal
if (!modal) return // since no div returned
this.stack.unshift(modalSubType ? `${modalType}_${modalSubType}` : modalType) // add to stack
this.init(modal) // add classes + starry bg
this.init(modal) // add classes + rising particles bg
this.observeRemoval(modal, modalType, modalSubType) // to maintain stack for proper nav
},

init(modal) {
if (!this.styles) this.stylize() // to init/append stylesheet
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
dom.fillStarryBG(modal) // add starry bg
dom.addRisingParticles(modal)
},

stylize() {
Expand Down
6 changes: 3 additions & 3 deletions chromium/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@

// Run MAIN routine

// Add STARS styles
// Add RISING PARTICLES styles
['black', 'white'].forEach(color => document.head.append(
dom.create.elem('link', { rel: 'stylesheet',
href: `https://assets.aiwebextensions.com/styles/rising-stars/dist/${
color}.min.css?v=0cde30f9ae3ce99ae998141f6e7a36de9b0cc2e7`
href: `https://assets.aiwebextensions.com/styles/rising-particles/dist/${
color}.min.css?v=727feff`
})))

// Observe DOM for need to continue generating response
Expand Down
18 changes: 9 additions & 9 deletions chromium/extension/lib/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ window.dom = {
}
},

fillStarryBG(targetNode) { // requires https://assets.aiwebextensions.com/styles/rising-stars/css/<black|white>.min.css
if (targetNode.querySelector('[id*=stars]')) return
const starsDivsContainer = document.createElement('div')
starsDivsContainer.style.cssText = 'position: absolute ; top: 0 ; left: 0 ;' // hug targetNode's top-left corner
addRisingParticles(targetNode) { // requires https://assets.aiwebextensions.com/styles/rising-particles/dist/<black|white>.min.css
if (targetNode.querySelector('[id*=particles]')) return
const particlesDivsContainer = document.createElement('div')
particlesDivsContainer.style.cssText = 'position: absolute ; top: 0 ; left: 0 ;' // hug targetNode's top-left corner
+ 'height: 100% ; width: 100% ; border-radius: 15px ; overflow: clip ;' // bound innards exactly by targetNode
+ 'z-index: -1'; // allow interactive elems to be clicked
['sm', 'med', 'lg'].forEach(starSize => {
const starsDiv = document.createElement('div')
starsDiv.id = `${ this.imports.env.ui.scheme == 'dark' ? 'white' : 'black' }-stars-${starSize}`
starsDivsContainer.append(starsDiv)
['sm', 'med', 'lg'].forEach(particleSize => {
const particlesDiv = document.createElement('div')
particlesDiv.id = `${ this.imports.env.ui.scheme == 'dark' ? 'white' : 'black' }-particles-${particleSize}`
particlesDivsContainer.append(particlesDiv)
})
targetNode.prepend(starsDivsContainer)
targetNode.prepend(particlesDivsContainer)
}
};
6 changes: 3 additions & 3 deletions firefox/extension/components/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ window.modals = {
alert(title = '', msg = '', btns = '', checkbox = '', width = '') { // generic one from chatgpt.alert()
const alertID = chatgpt.alert(title, msg, btns, checkbox, width),
alert = document.getElementById(alertID).firstChild
this.init(alert) // add classes + starry bg
this.init(alert) // add classes + rising particles bg
return alert
},

open(modalType, modalSubType) {
const modal = modalSubType ? this[modalType][modalSubType]() : this[modalType]() // show modal
if (!modal) return // since no div returned
this.stack.unshift(modalSubType ? `${modalType}_${modalSubType}` : modalType) // add to stack
this.init(modal) // add classes + starry bg
this.init(modal) // add classes + rising particles bg
this.observeRemoval(modal, modalType, modalSubType) // to maintain stack for proper nav
},

init(modal) {
if (!this.styles) this.stylize() // to init/append stylesheet
modal.classList.add('no-user-select', this.class) ; modal.parentNode.classList.add(`${this.class}-bg`)
dom.fillStarryBG(modal) // add starry bg
dom.addRisingParticles(modal)
},

stylize() {
Expand Down
6 changes: 3 additions & 3 deletions firefox/extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@

// Run MAIN routine

// Add STARS styles
// Add RISING PARTICLES styles
['black', 'white'].forEach(color => document.head.append(
dom.create.elem('link', { rel: 'stylesheet',
href: `https://assets.aiwebextensions.com/styles/rising-stars/dist/${
color}.min.css?v=0cde30f9ae3ce99ae998141f6e7a36de9b0cc2e7`
href: `https://assets.aiwebextensions.com/styles/rising-particles/dist/${
color}.min.css?v=727feff`
})))

// Observe DOM for need to continue generating response
Expand Down
18 changes: 9 additions & 9 deletions firefox/extension/lib/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ window.dom = {
}
},

fillStarryBG(targetNode) { // requires https://assets.aiwebextensions.com/styles/rising-stars/css/<black|white>.min.css
if (targetNode.querySelector('[id*=stars]')) return
const starsDivsContainer = document.createElement('div')
starsDivsContainer.style.cssText = 'position: absolute ; top: 0 ; left: 0 ;' // hug targetNode's top-left corner
addRisingParticles(targetNode) { // requires https://assets.aiwebextensions.com/styles/rising-particles/dist/<black|white>.min.css
if (targetNode.querySelector('[id*=particles]')) return
const particlesDivsContainer = document.createElement('div')
particlesDivsContainer.style.cssText = 'position: absolute ; top: 0 ; left: 0 ;' // hug targetNode's top-left corner
+ 'height: 100% ; width: 100% ; border-radius: 15px ; overflow: clip ;' // bound innards exactly by targetNode
+ 'z-index: -1'; // allow interactive elems to be clicked
['sm', 'med', 'lg'].forEach(starSize => {
const starsDiv = document.createElement('div')
starsDiv.id = `${ this.imports.env.ui.scheme == 'dark' ? 'white' : 'black' }-stars-${starSize}`
starsDivsContainer.append(starsDiv)
['sm', 'med', 'lg'].forEach(particleSize => {
const particlesDiv = document.createElement('div')
particlesDiv.id = `${ this.imports.env.ui.scheme == 'dark' ? 'white' : 'black' }-particles-${particleSize}`
particlesDivsContainer.append(particlesDiv)
})
targetNode.prepend(starsDivsContainer)
targetNode.prepend(particlesDivsContainer)
}
};
10 changes: 5 additions & 5 deletions greasemonkey/chatgpt-auto-continue.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
// @description:zu ⚡ Terus menghasilkan imibuzo eminingi ye-ChatGPT ngokwesizulu
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2025.1.29.1
// @version 2025.1.29.2
// @license MIT
// @icon https://assets.chatgptautocontinue.com/images/icons/continue-symbol/circled/with-robot/icon48.png?v=8b39fb4
// @icon64 https://assets.chatgptautocontinue.com/images/icons/continue-symbol/circled/with-robot/icon64.png?v=8b39fb4
Expand All @@ -231,8 +231,8 @@
// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-continue@7ad2c29/chromium/extension/components/modals.js#sha256-WsU/FpgwYrSF9pWPk0kDOaWiX4j44oDhxvItj95Zn7Q=
// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-continue@7644314/chromium/extension/lib/dom.js#sha256-x42VLAXHPZdt08Dp23Oo7AWqCRsK4EgfBEX3B1dyW4w=
// @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-auto-continue@7623f9e/chromium/extension/lib/settings.js#sha256-+1SzWklvhvhJPIE8vxmP6hgWBlxFS6st8SeSjC/Cvgg=
// @resource brsCSS https://assets.aiwebextensions.com/styles/rising-stars/dist/black.min.css?v=3289404#sha256-CTj6Ndngq+TsPlNpQ6Ej39PQKSDpmxyKUFohhc91ruQ=
// @resource wrsCSS https://assets.aiwebextensions.com/styles/rising-stars/dist/white.min.css?v=3289404#sha256-tOOIvIe6O5/x2A5E7s9kP4+zw0d4EEDfRgXQLq2KwLs=
// @resource brpCSS https://assets.aiwebextensions.com/styles/rising-particles/dist/black.min.css?v=727feff#sha256-7ycEGqwB5zKKoaW3olhaFP8yj0KEXe+Ks2kS/4iRGZM=
// @resource wrpCSS https://assets.aiwebextensions.com/styles/rising-particles/dist/white.min.css?v=727feff#sha256-6xBXczm7yM1MZ/v0o1KVFfJGehHk47KJjq8oTktH4KE=
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_registerMenuCommand
Expand Down Expand Up @@ -490,8 +490,8 @@

menu.register() ; if (env.extensionInstalled) return

// Add STARS styles
['brs', 'wrs'].forEach(cssType => document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))
// Add RISING PARTICLES styles
['brp', 'wrp'].forEach(cssType => document.head.append(dom.create.style(GM_getResourceText(`${cssType}CSS`))))

// Observe DOM for need to continue generating response
checkContinueBtn()
Expand Down
13 changes: 7 additions & 6 deletions utils/bump/resources.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

// Bumps @require'd JS + rising-stars CSS @resource's in userscript
// Bumps @require'd JS + rising-particles CSS @resource's in userscript
// NOTE: Doesn't git commit to allow script editing from breaking changes

(async () => {
Expand Down Expand Up @@ -111,10 +111,11 @@
const resURLs = [...userJScontent.matchAll(reResURL)].map(match => match[1] || match[2])
log.success(`${resURLs.length} potentially bumpable resource(s) found.`)

// Fetch latest commit hash for adamlui/ai-web-extensions/assets/styles/rising-stars
const risingStarsPath = 'assets/styles/rising-stars'
log.working(`\nFetching latest commit hash for ${risingStarsPath}...\n`)
const latestCommitHashes = { risingStars: await getLatestCommitHash('adamlui/ai-web-extensions', risingStarsPath) }
// Fetch latest commit hash for adamlui/ai-web-extensions/assets/styles/rising-particles
const risingParticlesPath = 'assets/styles/rising-particles'
log.working(`\nFetching latest commit hash for ${risingParticlesPath}...\n`)
const latestCommitHashes = {
risingParticles: await getLatestCommitHash('adamlui/ai-web-extensions', risingParticlesPath) }

log.working('\nProcessing resource(s)...\n')
let urlsUpdatedCnt = 0
Expand All @@ -131,7 +132,7 @@
const resName = rePatterns.resName.exec(resURL)?.[0] || 'resource' // dir/filename for logs

// Compare/update commit hash
let resLatestCommitHash = latestCommitHashes[resURL.includes(repoName) ? 'chromium' : 'risingStars']
let resLatestCommitHash = latestCommitHashes[resURL.includes(repoName) ? 'chromium' : 'risingParticles']
if (resLatestCommitHash.startsWith( // compare hashes
rePatterns.commitHash.exec(resURL)?.[2] || '')) { // commit hash didn't change...
console.log(`${resName} already up-to-date!`) ; log.endedWithLineBreak = false
Expand Down

0 comments on commit d27ed79

Please sign in to comment.