From 8c5f610c28e6cdc0fed212e481c0f69fcfbb39b9 Mon Sep 17 00:00:00 2001 From: kudo-sync-bot Date: Wed, 29 Jan 2025 21:20:26 -0800 Subject: [PATCH] =?UTF-8?q?Updated=20rising-stars=20func/var/meta=20names?= =?UTF-8?q?=20+=20paths=20+=20comments=20=E2=86=9E=20[auto-sync=20from=20h?= =?UTF-8?q?ttps://github.com/adamlui/ai-web-extensions/tree/main/chatgpt-w?= =?UTF-8?q?idescreen]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chromium/extension/components/modals.js | 6 +++--- chromium/extension/content.js | 6 +++--- chromium/extension/lib/dom.js | 18 +++++++++--------- firefox/extension/components/modals.js | 6 +++--- firefox/extension/content.js | 6 +++--- firefox/extension/lib/dom.js | 18 +++++++++--------- greasemonkey/chatgpt-widescreen-mode.user.js | 10 +++++----- utils/bump/resources.js | 13 +++++++------ 8 files changed, 42 insertions(+), 41 deletions(-) diff --git a/chromium/extension/components/modals.js b/chromium/extension/components/modals.js index f7a66d1e0..7bc3b98fd 100644 --- a/chromium/extension/components/modals.js +++ b/chromium/extension/components/modals.js @@ -25,7 +25,7 @@ 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 }, @@ -33,14 +33,14 @@ window.modals = { 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() { diff --git a/chromium/extension/content.js b/chromium/extension/content.js index 0c4936f9b..6174aa2e6 100644 --- a/chromium/extension/content.js +++ b/chromium/extension/content.js @@ -353,11 +353,11 @@ update.style.tweaks() ; document.head.append(tweaksStyle); - // 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` }))) // Create WIDESCREEN style diff --git a/chromium/extension/lib/dom.js b/chromium/extension/lib/dom.js index 3049e1528..c12c22a6f 100644 --- a/chromium/extension/lib/dom.js +++ b/chromium/extension/lib/dom.js @@ -31,18 +31,18 @@ window.dom = { .replace(/^| /g, '.') // prefix w/ dot, convert spaces to dots }, - fillStarryBG(targetNode) { // requires https://assets.aiwebextensions.com/styles/rising-stars/css/.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/.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) }, getLoadedElem(selector, timeout = null) { diff --git a/firefox/extension/components/modals.js b/firefox/extension/components/modals.js index f7a66d1e0..7bc3b98fd 100644 --- a/firefox/extension/components/modals.js +++ b/firefox/extension/components/modals.js @@ -25,7 +25,7 @@ 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 }, @@ -33,14 +33,14 @@ window.modals = { 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() { diff --git a/firefox/extension/content.js b/firefox/extension/content.js index 0c4936f9b..6174aa2e6 100644 --- a/firefox/extension/content.js +++ b/firefox/extension/content.js @@ -353,11 +353,11 @@ update.style.tweaks() ; document.head.append(tweaksStyle); - // 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` }))) // Create WIDESCREEN style diff --git a/firefox/extension/lib/dom.js b/firefox/extension/lib/dom.js index 3049e1528..c12c22a6f 100644 --- a/firefox/extension/lib/dom.js +++ b/firefox/extension/lib/dom.js @@ -31,18 +31,18 @@ window.dom = { .replace(/^| /g, '.') // prefix w/ dot, convert spaces to dots }, - fillStarryBG(targetNode) { // requires https://assets.aiwebextensions.com/styles/rising-stars/css/.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/.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) }, getLoadedElem(selector, timeout = null) { diff --git a/greasemonkey/chatgpt-widescreen-mode.user.js b/greasemonkey/chatgpt-widescreen-mode.user.js index 2f7ff2680..e3b16ab72 100644 --- a/greasemonkey/chatgpt-widescreen-mode.user.js +++ b/greasemonkey/chatgpt-widescreen-mode.user.js @@ -235,7 +235,7 @@ // @description:zu Thuthukisa iChatGPT ngemodi zesikrini ezibanzi/egcwele/ephezulu + imodi yokuvimbela i-spam. Futhi isebenza ku-perplexity.ai + poe.com! // @author Adam Lui // @namespace https://github.com/adamlui -// @version 2025.1.29.1 +// @version 2025.1.29.2 // @license MIT // @icon https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon48.png?v=844b16e // @icon64 https://assets.chatgptwidescreen.com/images/icons/widescreen-robot-emoji/icon64.png?v=844b16e @@ -259,8 +259,8 @@ // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@bbd0ea4/chromium/extension/lib/settings.js#sha256-zmX98Pku2DFY9SI0KBy6Ix6lUJIh8FNtqbAO8nnFE6k= // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@bbd0ea4/chromium/extension/components/buttons.js#sha256-cf8uqPcLdpEPM21OSeh2Xj2mi987eeGtg+wXR1EmHlI= // @require https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@6fc65c4/chromium/extension/components/modals.js#sha256-qQtlKpnAqUAwoTAxVtKStahUlbwcDYrqTBbfYfqOIzc= -// @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 @@ -791,8 +791,8 @@ update.style.tweaks() ; document.head.append(tweaksStyle); - // 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`)))) // Create WIDESCREEN style const wideScreenStyle = dom.create.style() diff --git a/utils/bump/resources.js b/utils/bump/resources.js index 6a6891469..f198106bf 100644 --- a/utils/bump/resources.js +++ b/utils/bump/resources.js @@ -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 () => { @@ -107,10 +107,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 @@ -127,7 +128,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