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 adc1ee2 commit 5529400
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
// @description:zu Ziba itshala lokucabanga okuzoshintshwa ngokuzenzakalelayo uma ukubuka chatgpt.com
// @author Adam Lui
// @namespace https://github.com/adamlui
// @version 2024.12.1
// @version 2024.12.1.1
// @license MIT
// @icon https://media.autoclearchatgpt.com/images/icons/openai/black/icon48.png?a8868ef
// @icon64 https://media.autoclearchatgpt.com/images/icons/openai/black/icon64.png?a8868ef
Expand Down Expand Up @@ -277,7 +277,10 @@
const xhr = env.scriptManager.name == 'OrangeMonkey' ? GM_xmlhttpRequest : GM.xmlHttpRequest

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

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

// Show alert
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 5529400

Please sign in to comment.