Skip to content

Commit

Permalink
Moved chatgptJSver into app + added app.version ↞ [auto-sync from
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Dec 1, 2024
1 parent 63bb48c commit 72a1716
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions greasemonkey/chatgpt-widescreen-mode.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
// @description:zu Yengeza Isikrini Esibanzi + Izindlela Zesikrini Esigcwele ku-chatgpt.com + perplexity.ai + poe.com ukuze uthole ukubuka okuthuthukisiwe + okuncishisiwe ukuskrola
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.12.1.1
// @version 2024.12.1.2
// @license MIT
// @compatible chrome
// @compatible firefox
Expand Down Expand Up @@ -282,7 +282,10 @@
const xhr = env.scriptManager.name == 'OrangeMonkey' ? GM_xmlhttpRequest : GM.xmlHttpRequest

// Init APP data
const app = { configKeyPrefix: `${env.site} Widescreen`, latestAssetCommitHash: '861a313', urls: {} }
const app = {
version: GM_info.script.version, configKeyPrefix: `${env.site} Widescreen`,
chatgptJSver: /chatgpt\.js@([\d.]+)/.exec(GM_info.script.header)[1], urls: {}, latestAssetCommitHash: '861a313'
}
app.urls.assetHost = `https://cdn.jsdelivr.net/gh/adamlui/chatgpt-widescreen@${app.latestAssetCommitHash}`
const appData = await new Promise(resolve => xhr({
method: 'GET', url: `${app.urls.assetHost}/data/app.json`,
Expand Down Expand Up @@ -566,20 +569,21 @@
show() {
modals.stack.unshift('about') ; modals.stack = [...new Set(modals.stack)] // track for nav

// Show alert
const chatgptJSver = (/chatgpt-([\d.]+)\.min/.exec(GM_info.script.header) || [null, ''])[1],
headingStyle = 'font-size: 1.15rem',
// Init styles
const headingStyle = 'font-size: 1.15rem',
pStyle = 'position: relative ; left: 3px',
pBrStyle = 'position: relative ; left: 4px ',
aStyle = 'color: ' + ( chatgpt.isDarkMode() ? '#c67afb' : '#8325c4' ) // purple

// Show modal
const aboutModal = siteAlert(
`${app.symbol} ${app.msgs.appName}`, // title
`<span style="${headingStyle}"><b>🏷️ <i>${app.msgs.about_version}</i></b>: </span>`
+ `<span style="${pStyle}">${GM_info.script.version}</span>\n`
+ `<span style="${pStyle}">${app.version}</span>\n`
+ `<span style="${headingStyle}"><b>⚡ <i>${app.msgs.about_poweredBy}</i></b>: </span>`
+ `<span style="${pStyle}">`
+ `<a style="${aStyle}" href="${app.urls.chatgptJS}" target="_blank" rel="noopener">`
+ 'chatgpt.js</a>' + ( chatgptJSver ? ( ' v' + chatgptJSver ) : '' ) + '</span>\n'
+ `chatgpt.js</a> v${app.chatgptJSver}</span>\n`
+ `<span style="${headingStyle}"><b>📜 <i>${app.msgs.about_sourceCode}</i></b>:</span>\n`
+ `<span style="${pBrStyle}"><a href="${app.urls.gitHub}" target="_blank" rel="nopener">`
+ app.urls.gitHub + '</a></span>',
Expand Down

0 comments on commit 72a1716

Please sign in to comment.