diff --git a/src/Powercord/plugins/pc-updater/components/Icons.jsx b/src/Powercord/plugins/pc-updater/components/Icons.jsx deleted file mode 100644 index dc8a71d..0000000 --- a/src/Powercord/plugins/pc-updater/components/Icons.jsx +++ /dev/null @@ -1,52 +0,0 @@ -const { React } = require('powercord/webpack'); - -module.exports = { - UpToDate: () => - - , - Update: ({ color, animated }) => - - - - , - Paused: () => - - , - Error: () => - - , - - Powercord: (props) => - - , - Plugin: (props) => - - , - Theme: (props) => - - -}; diff --git a/src/Powercord/plugins/pc-updater/components/Settings.jsx b/src/Powercord/plugins/pc-updater/components/Settings.jsx deleted file mode 100644 index a1b8b9b..0000000 --- a/src/Powercord/plugins/pc-updater/components/Settings.jsx +++ /dev/null @@ -1,464 +0,0 @@ -const { React, getModule, i18n: { Messages, _chosenLocale: currentLocale } } = require('powercord/webpack'); -const { Button, FormNotice, FormTitle, Tooltip, Icons: { FontAwesome } } = require('powercord/components'); -const { SwitchItem, TextInput, Category, ButtonItem } = require('powercord/components/settings'); -const { open: openModal, close: closeModal } = require('powercord/modal'); -const { Confirm } = require('powercord/components/modal'); -const { REPO_URL, CACHE_FOLDER } = require('powercord/constants'); -const { clipboard } = require('electron'); -const { readdirSync, existsSync, lstatSync } = require('fs'); - -const Icons = require('./Icons'); -const Update = require('./Update'); - -module.exports = class UpdaterSettings extends React.PureComponent { - constructor () { - super(); - this.plugin = powercord.pluginManager.get('pc-updater'); - this.state = { - opened: false, - copied: false - }; - } - - render () { - const isUnsupported = window.GLOBAL_ENV.RELEASE_CHANNEL !== 'canary'; - const moment = getModule([ 'momentProperties' ], false); - // @todo: Make this be in its own store - const awaitingReload = this.props.getSetting('awaiting_reload', false); - const updating = this.props.getSetting('updating', false); - const checking = this.props.getSetting('checking', false); - const disabled = this.props.getSetting('disabled', false); - const paused = this.props.getSetting('paused', false); - const failed = this.props.getSetting('failed', false); - - const updates = this.props.getSetting('updates', []); - const disabledEntities = this.props.getSetting('entities_disabled', []); - const checkingProgress = this.props.getSetting('checking_progress', [ 0, 0 ]); - const last = moment(this.props.getSetting('last_check', false)).calendar(); - - let icon, - title; - if (disabled) { - icon = ; - title = Messages.POWERCORD_UPDATES_DISABLED; - } else if (paused) { - icon = ; - title = Messages.POWERCORD_UPDATES_PAUSED; - } else if (checking) { - icon = ; - title = Messages.POWERCORD_UPDATES_CHECKING; - } else if (updating) { - icon = ; - title = Messages.POWERCORD_UPDATES_UPDATING; - } else if (failed) { - icon = ; - title = Messages.POWERCORD_UPDATES_FAILED; - } else if (updates.length > 0) { - icon = ; - title = Messages.POWERCORD_UPDATES_AVAILABLE; - } else { - icon = ; - title = Messages.POWERCORD_UPDATES_UP_TO_DATE; - } - - return
- {awaitingReload - ? this.renderReload() - : isUnsupported && this.renderUnsupported()} -
-
{icon}
-
-

{title}

- {!disabled && !updating && (!checking || checkingProgress[1] > 0) &&
- {paused - ? Messages.POWERCORD_UPDATES_PAUSED_RESUME - : checking - ? Messages.POWERCORD_UPDATES_CHECKING_STATUS.format({ - checked: checkingProgress[0], - total: checkingProgress[1] - }) - : Messages.POWERCORD_UPDATES_LAST_CHECKED.format({ date: last })} -
} -
-
-
- {Messages.POWERCORD_UPDATES_UPSTREAM} - {powercord.gitInfos.upstream.replace(REPO_URL, Messages.POWERCORD_UPDATES_UPSTREAM_OFFICIAL)} -
-
- {Messages.POWERCORD_UPDATES_REVISION} - {powercord.gitInfos.revision.substring(0, 7)} -
-
- {Messages.POWERCORD_UPDATES_BRANCH} - {powercord.gitInfos.branch} -
-
-
-
- {disabled || paused - ? - : (!checking && !updating && <> - {updates.length > 0 && } - - - - )} -
- {!disabled && !paused && !checking && updates.length > 0 &&
- {updates.map(update => this.askSkipUpdate(() => this.plugin.skipUpdate(update.id, update.commits[0].id))} - onDisable={() => this.askDisableUpdates(false, () => this.plugin.disableUpdates(update))} - />)} -
} - - {disabledEntities.length > 0 && this.setState({ opened: !this.state.opened })} - > - {disabledEntities.map(entity =>
-
-
- - {React.createElement(Icons[entity.icon])} - -
-
{entity.name}
-
- -
-
-
)} -
} - {Messages.OPTIONS} - {!disabled && <> - this.props.toggleSetting('automatic')} - note={Messages.POWERCORD_UPDATES_OPTS_AUTO_DESC} - > - {Messages.POWERCORD_UPDATES_OPTS_AUTO} - - this.props.updateSetting('interval', (Number(val) && Number(val) >= 10) ? Math.ceil(Number(val)) : 10, 15)} - defaultValue={this.props.getSetting('interval', 15)} - required={true} - > - {Messages.POWERCORD_UPDATES_OPTS_INTERVAL} - - this.props.updateSetting('concurrency', (Number(val) && Number(val) >= 1) ? Math.ceil(Number(val)) : 1, 2)} - defaultValue={this.props.getSetting('concurrency', 2)} - required={true} - > - {Messages.POWERCORD_UPDATES_OPTS_CONCURRENCY} - - this.plugin.openChangeLogs()} - > - {Messages.POWERCORD_UPDATES_OPTS_CHANGE_LOGS} - - {/* this.askChangeChannel( - () => this.plugin.changeBranch(powercord.gitInfos.branch === 'v2' ? 'v2-dev' : 'v2') - )} - > - {Messages.POWERCORD_UPDATES_OPTS_RELEASE} - */} - - this.setState({ debugInfoOpened: !this.state.debugInfoOpened })} - > - {this.renderDebugInfo(moment)} - - } -
; - } - - // --- PARTS - renderReload () { - const body = <> -

{Messages.POWERCORD_UPDATES_AWAITING_RELOAD_DESC}

- - ; - return this._renderFormNotice(Messages.POWERCORD_UPDATES_AWAITING_RELOAD_TITLE, body); - } - - renderUnsupported () { - const body =

- {Messages.POWERCORD_UPDATES_UNSUPPORTED_DESC.format({ releaseChannel: window.GLOBAL_ENV.RELEASE_CHANNEL })} -

; - return this._renderFormNotice(Messages.POWERCORD_UPDATES_UNSUPPORTED_TITLE, body); - } - - _renderFormNotice (title, body) { - return ; - } - - // --- PROMPTS - askSkipUpdate (callback) { - this._ask( - Messages.POWERCORD_UPDATES_SKIP_MODAL_TITLE, - Messages.POWERCORD_UPDATES_SKIP_MODAL, - Messages.POWERCORD_UPDATES_SKIP, - callback - ); - } - - askPauseUpdates () { - this._ask( - Messages.POWERCORD_UPDATES_PAUSE, - Messages.POWERCORD_UPDATES_PAUSE_MODAL, - Messages.POWERCORD_UPDATES_PAUSE, - () => this.props.updateSetting('paused', true) - ); - } - - askDisableUpdates (all, callback) { - this._ask( - Messages.POWERCORD_UPDATES_DISABLE, - all ? Messages.POWERCORD_UPDATES_DISABLE_MODAL_ALL : Messages.POWERCORD_UPDATES_DISABLE_MODAL, - Messages.POWERCORD_UPDATES_DISABLE, - callback - ); - } - - askChangeChannel (callback) { - this._ask( - Messages.POWERCORD_UPDATES_OPTS_RELEASE_MODAL_HEADER, - Messages.POWERCORD_UPDATES_OPTS_RELEASE_MODAL, - Messages.POWERCORD_UPDATES_OPTS_RELEASE_SWITCH, - callback - ); - } - - _ask (title, content, confirm, callback, red = true) { - openModal(() => -
{content}
-
); - } - - // --- DEBUG STUFF (Intentionally left english-only) - renderDebugInfo () { - const { getRegisteredExperiments, getExperimentOverrides } = getModule([ 'initialize', 'getExperimentOverrides' ], false); - const { apiManager: { apis }, api: { commands: { commands }, settings: { store: settingsStore } } } = powercord; - const superProperties = getModule([ 'getSuperPropertiesBase64' ], false).getSuperProperties(); - const unauthorizedPlugins = Array.from(powercord.pluginManager.plugins.values()).filter(plugin => - plugin.__shortCircuit).map(plugin => plugin.manifest.name); - const plugins = powercord.pluginManager.getPlugins().filter(plugin => - !powercord.pluginManager.get(plugin).isInternal && powercord.pluginManager.isEnabled(plugin) - ); - - const enabledLabs = powercord.api.labs.experiments.filter(e => powercord.api.labs.isExperimentEnabled(e.id)); - const experimentOverrides = Object.keys(getExperimentOverrides()).length; - const availableExperiments = Object.keys(getRegisteredExperiments()).length; - - const discordPath = process.resourcesPath.slice(0, -10); - const maskPath = (path) => { - path = path.replace(/(?:\/home\/|C:\\Users\\|\/Users\/)([ \w.-]+).*/i, (path, username) => { - const usernameIndex = path.indexOf(username); - return [ path.slice(0, usernameIndex), username.charAt(0) + username.slice(1).replace(/[a-zA-Z]/g, '*'), - path.slice(usernameIndex + username.length) ].join(''); - }); - - return path; - }; - - const cachedFiles = (existsSync(CACHE_FOLDER) && readdirSync(CACHE_FOLDER) - .filter(d => lstatSync(`${CACHE_FOLDER}/${d}`).isDirectory()) - .map(d => readdirSync(`${CACHE_FOLDER}/${d}`)) - .flat().length) || 'n/a'; - - const createPathReveal = (title, path) => - ; - - return - - System / Discord -
-
Locale: {currentLocale}
-
OS: {window.platform.os.family}{window.platform.os.architecture === 64 ? ' 64-bit' : ''}
-
Architecture: {superProperties.os_arch}
- {process.platform === 'linux' && ( -
Distro: {superProperties.distro || 'n/a'}
- )} -
Release Channel: {superProperties.release_channel}
-
App Version: {superProperties.client_version}
-
Build Number: {superProperties.client_build_number}
-
Build ID: {window.GLOBAL_ENV.SENTRY_TAGS.buildId.slice(0, 7)}
-
Experiments: {experimentOverrides} / {availableExperiments}
-
- - Process Versions -
-
React: {React.version}
- {[ 'electron', 'chrome', 'node' ].map(proc => -
{proc.charAt(0).toUpperCase() + proc.slice(1)}: {process.versions[proc]}
- )} -
- - Powercord -
-
Commands: {Object.keys(commands).length}
-
Settings: {Object.keys(settingsStore.getAllSettings()).length}
-
Plugins: {powercord.pluginManager.getPlugins() - .filter(plugin => powercord.pluginManager.isEnabled(plugin)).length} / {powercord.pluginManager.plugins.size} -
-
Themes: {powercord.styleManager.getThemes() - .filter(theme => powercord.styleManager.isEnabled(theme)).length} / {powercord.styleManager.themes.size} -
-
Labs: {enabledLabs.length} / {powercord.api.labs.experiments.length} -
-
{`Settings Sync:\n${powercord.settings.get('settingsSync', false)}`}
-
Cached Files: {cachedFiles}
-
{`Account:\n${!!powercord.account}`}
-
APIs: {apis.length}
-
- - Git -
-
Upstream: {powercord.gitInfos.upstream.replace(REPO_URL, 'Official')}
- -
Branch: {powercord.gitInfos.branch}
-
{`Latest:\n${!this.props.getSetting('updates', []).find(update => update.id === 'powercord')}`}
-
- - Listings -
- {createPathReveal('Powercord Path', powercord.basePath)} - {createPathReveal('Discord Path', discordPath)} -
Experiments: {experimentOverrides > 0 ? Object.keys(getExperimentOverrides()).join(', ') : 'n/a'}
-
Labs: - {enabledLabs.length ? enabledLabs.map(e => e.name).join(', ') : 'n/a'} -
-
- Plugins: - {(plugins.length > 6 ? `${(this.state.pluginsRevealed ? plugins : plugins.slice(0, 6)).join(', ')};` : plugins.join(', ')) || 'n/a'}  - {plugins.length > 6 && - this.setState({ pluginsRevealed: !this.state.pluginsRevealed })}> - {this.state.pluginsRevealed ? 'Show less' : 'Show more'} - } -
- {unauthorizedPlugins.length > 0 &&
- Unauthorized Plugins: - {unauthorizedPlugins.join(', ')} -
} - {window.bdplugins &&
- BetterDiscord Plugins: - {Object.keys(window.bdplugins).join(', ')} -
} -
-
- - } - />; - } - - handleDebugInfoCopy (plugins) { - const extract = document.querySelector('.debug-info > code') - .innerText.replace(/([A-Z/ ]+) (?=\s(?!C:\\).*?:)/g, '\n[$1]').replace(/(.*?):\s(.*.+)/g, '$1="$2"').replace(/[ -](\w*(?=.*=))/g, '$1'); - - this.setState({ copied: true }); - clipboard.writeText( - `\`\`\`ini - # Debugging Information | Result created: ${new Date().toUTCString()} - ${extract.substring(0, extract.indexOf('\nPlugins', extract.indexOf('\nPlugins') + 1))} - Plugins="${plugins.join(', ')}"${window.bdplugins ? `\nBDPlugins="${Object.keys(window.bdplugins).join(', ')}"` : ''} - \`\`\``.replace(/ {6}|n\/a/g, '').replace(/(?![0-9]{1,3}) \/ (?=[0-9]{1,3})/g, '/') - ); - setTimeout(() => this.setState({ copied: false }), 2500); - } -}; diff --git a/src/Powercord/plugins/pc-updater/components/Update.jsx b/src/Powercord/plugins/pc-updater/components/Update.jsx deleted file mode 100644 index d2d9fb7..0000000 --- a/src/Powercord/plugins/pc-updater/components/Update.jsx +++ /dev/null @@ -1,45 +0,0 @@ -const { React, i18n: { Messages } } = require('powercord/webpack'); -const { Button } = require('powercord/components'); - -const Icons = require('./Icons'); - -module.exports = class Update extends React.PureComponent { - constructor () { - super(); - this.plugin = powercord.pluginManager.get('pc-updater'); - } - - render () { - const { name, icon, repo, commits, updating, onSkip, onDisable } = this.props; - return
-
-
- {React.createElement(Icons[icon])} -
-
{name}
-
- {updating - ? - : <> - - - } -
-
-
- {commits.map(commit =>
- - {commit.id.substring(0, 7)} - - {commit.message} - {commit.author} -
)} -
-
; - } -}; diff --git a/src/Powercord/plugins/pc-updater/index.js b/src/Powercord/plugins/pc-updater/index.js deleted file mode 100644 index 2a531d8..0000000 --- a/src/Powercord/plugins/pc-updater/index.js +++ /dev/null @@ -1,371 +0,0 @@ -const { React, getModule, getModuleByDisplayName, i18n: { Messages } } = require('powercord/webpack'); -const { open: openModal, close: closeModal } = require('powercord/modal'); -const { Confirm } = require('powercord/components/modal'); -const { Plugin } = require('powercord/entities'); - -const { join } = require('path'); -const { promisify } = require('util'); -const cp = require('child_process'); -const exec = promisify(cp.exec); - -const Settings = require('./components/Settings.jsx'); - -const changelog = require('../../../../changelogs.json'); - -module.exports = class Updater extends Plugin { - constructor () { - super(); - - this.checking = false; - this.cwd = { cwd: join(__dirname, ...Array(4).fill('..')) }; - } - - async startPlugin () { - this.settings.set('paused', false); - this.settings.set('failed', false); - this.settings.set('checking', false); - this.settings.set('updating', false); - this.settings.set('awaiting_reload', false); - this.settings.set('checking_progress', null); - - this.loadStylesheet('style.scss'); - powercord.api.settings.registerSettings('pc-updater', { - category: this.entityID, - label: 'Updater', // Note to self: add this string to i18n last :^) - render: Settings - }); - - let minutes = Number(this.settings.get('interval', 15)); - if (minutes < 1) { - this.settings.set('interval', 1); - minutes = 1; - } - - this._interval = setInterval(this.checkForUpdates.bind(this), minutes * 60 * 1000); - setTimeout(() => { - this.checkForUpdates(); - }, 10e3); - - const lastChangelog = this.settings.get('last_changelog', ''); - if (changelog.id !== lastChangelog) { - this.openChangeLogs(); - } - } - - pluginWillUnload () { - powercord.api.settings.unregisterSettings('pc-updater'); - clearInterval(this._interval); - } - - async checkForUpdates (allConcurrent = false) { - if ( - this.settings.get('disabled', false) || - this.settings.get('paused', false) || - this.settings.get('checking', false) || - this.settings.get('updating', false) - ) { - return; - } - - this.settings.set('checking', true); - this.settings.set('checking_progress', [ 0, 0 ]); - const disabled = this.settings.get('entities_disabled', []).map(e => e.id); - const skipped = this.settings.get('entities_skipped', []); - const plugins = [ ...powercord.pluginManager.plugins.values() ].filter(p => !p.isInternal); - const themes = [ ...powercord.styleManager.themes.values() ]; - - const entities = plugins.concat(themes).filter(e => !disabled.includes(e.updateIdentifier) && e.isUpdatable()); - if (!disabled.includes(powercord.updateIdentifier)) { - entities.push(powercord); - } - - let done = 0; - const updates = []; - const entitiesLength = entities.length; - const parallel = allConcurrent ? entitiesLength : this.settings.get('concurrency', 2); - await Promise.all(Array(parallel).fill(null).map(async () => { - let entity; - while ((entity = entities.shift())) { - try { - const repo = await entity.getGitRepo(); - if (repo) { - const shouldUpdate = await entity._checkForUpdates(); - if (shouldUpdate) { - const commits = await entity._getUpdateCommits(); - if (commits[0] && skipped[entity.updateIdentifier] === commits[0].id) { - continue; - } - updates.push({ - id: entity.updateIdentifier, - name: entity.manifest?.name ?? 'Powercord', - icon: entity.constructor.name === 'Theme' || entity.constructor.name === 'Powercord' - ? entity.constructor.name - : 'Plugin', - commits, - repo - }); - } - } - } catch (e) { - console.error('An error occurred while checking for updates for %s', entity.manifest?.name ?? 'Powercord', e); - } finally { - this.settings.set('checking_progress', [ ++done, entitiesLength ]); - } - } - })); - - this.settings.set('updates', updates); - this.settings.set('last_check', Date.now()); - this.settings.set('checking', false); - if (updates.length > 0) { - if (this.settings.get('automatic', false)) { - this.doUpdate(); - } else if (!document.querySelector('#powercord-updater, .powercord-updater')) { - powercord.api.notices.sendToast('powercord-updater', { - header: Messages.POWERCORD_UPDATES_TOAST_AVAILABLE_HEADER, - content: Messages.POWERCORD_UPDATES_TOAST_AVAILABLE_DESC, - icon: 'wrench', - buttons: [ { - text: Messages.POWERCORD_UPDATES_UPDATE, - color: 'green', - look: 'outlined', - onClick: () => this.doUpdate() - }, { - text: Messages.POWERCORD_UPDATES_OPEN_UPDATER, - color: 'blue', - look: 'ghost', - onClick: async () => { - const settingsModule = await getModule([ 'open', 'saveAccountChanges' ]); - settingsModule.open('pc-updater'); - } - } ] - }); - } - } - } - - async doUpdate (force = false) { - this.settings.set('failed', false); - this.settings.set('updating', true); - const updates = this.settings.get('updates', []); - const failed = []; - for (const update of [ ...updates ]) { - let entity = powercord; - if (update.id.startsWith('plugin')) { - entity = powercord.pluginManager.get(update.id.replace('plugins_', '')); - } else if (update.id.startsWith('theme')) { - entity = powercord.styleManager.get(update.id.replace('themes_', '')); - } - - const success = await entity._update(force); - updates.shift(); - this.settings.get('updates', updates); - if (!success) { - failed.push(update); - } - } - - this.settings.set('updating', false); - if (failed.length > 0) { - this.settings.set('failed', true); - this.settings.set('updates', failed); - if (!document.querySelector('#powercord-updater, .powercord-updater')) { - powercord.api.notices.sendToast('powercord-updater', { - header: Messages.POWERCORD_UPDATES_TOAST_FAILED, - type: 'danger', - buttons: [ { - text: Messages.POWERCORD_UPDATES_FORCE, - color: 'red', - look: 'outlined', - onClick: () => this.askForce() - }, { - text: Messages.FRIEND_REQUEST_IGNORE, - look: 'outlined', - color: 'grey' - }, { - text: Messages.POWERCORD_UPDATES_OPEN_UPDATER, - color: 'blue', - look: 'ghost', - onClick: async () => { - const settingsModule = await getModule([ 'open', 'saveAccountChanges' ]); - settingsModule.open('pc-updater'); - } - } ] - }); - } - } - } - - // MODALS - askForce (callback) { - openModal(() => - React.createElement(Confirm, { - red: true, - header: Messages.SUPPRESS_EMBED_TITLE, - confirmText: Messages.POWERCORD_UPDATES_FORCE, - cancelText: Messages.CANCEL, - onConfirm: () => { - if (callback) { - // eslint-disable-next-line callback-return - callback(); - } - this.doUpdate(true); - }, - onCancel: closeModal - }, React.createElement('div', { className: 'powercord-text' }, Messages.POWERCORD_UPDATES_FORCE_MODAL)) - ); - } - - // UTILS - skipUpdate (id, commit) { - this.settings.set('entities_skipped', { - ...this.settings.get('entities_skipped', {}), - [id]: commit - }); - this._removeUpdate(id); - } - - disableUpdates (entity) { - this.settings.set('entities_disabled', [ - ...this.settings.get('entities_disabled', []), - { - id: entity.id, - name: entity.name, - icon: entity.icon - } - ]); - this._removeUpdate(entity.id); - } - - enableUpdates (id) { - this.settings.set('entities_disabled', this.settings.get('entities_disabled', []).filter(d => d.id !== id)); - } - - _removeUpdate (id) { - this.settings.set('updates', this.settings.get('updates', []).filter(u => u.id !== id)); - } - - async getGitInfos () { - const branch = await exec('git branch', this.cwd) - .then(({ stdout }) => - stdout - .toString() - .split('\n') - .find(l => l.startsWith('*')) - .slice(2) - .trim() - ); - - const revision = await exec(`git rev-parse ${branch}`, this.cwd) - .then(r => r.stdout.toString().trim()); - - const upstream = await exec('git remote get-url origin', this.cwd) - .then(r => r.stdout.toString().match(/github\.com[:/]([\w-_]+\/[\w-_]+)/)[1]); - - return { - upstream, - branch, - revision - }; - } - - async changeBranch (branch) { - await exec('git fetch origin +v2:v2', this.cwd); - await exec(`git checkout ${branch}`, this.cwd); - // location.reload(); - } - - // Change Log - async openChangeLogs () { - const ChangeLog = await this._getChangeLogsComponent(); - openModal(() => React.createElement(ChangeLog, { - changeLog: this.formatChangeLog(changelog) - })); - } - - async _getChangeLogsComponent () { - if (!this._ChangeLog) { - const _this = this; - const { video } = await getModule([ 'video', 'added' ]); - const DiscordChangeLog = await getModuleByDisplayName('ChangelogStandardTemplate'); - - class ChangeLog extends DiscordChangeLog { - constructor (props) { - super(props); - - this.oldRenderHeader = this.renderHeader; - this.renderHeader = this.renderNewHeader.bind(this); - - this.track = () => void 0; - this.handleScroll = () => void 0; - } - - renderNewHeader () { - const header = this.oldRenderHeader(); - header.props.children[0].props.children = `Powercord - ${header.props.children[0].props.children}`; - return header; - } - - renderVideo () { - if (!changelog.image) { - return null; - } - - return React.createElement('img', { - src: changelog.image, - className: video, - alt: '' - }); - } - - renderFooter () { - const footer = super.renderFooter(); - footer.props.children = React.createElement('span', { - style: { color: 'var(--text-normal)' }, - dangerouslySetInnerHTML: { - __html: changelog.footer - } - }); - return footer; - } - - componentWillUnmount () { - _this.settings.set('last_changelog', changelog.id); - } - } - - this._ChangeLog = ChangeLog; - } - return this._ChangeLog; - } - - formatChangeLog (json) { - let body = ''; - const colorToClass = { - GREEN: 'added', - ORANGE: 'progress', - RED: 'fixed', - BLURPLE: 'improved' - }; - json.contents.forEach(item => { - if (item.type === 'HEADER') { - body += `${item.text.toUpperCase()} {${colorToClass[item.color]}${item.noMargin ? ' marginTop' : ''}}\n======================\n\n`; - } else { - if (item.text) { - body += item.text; - body += '\n\n'; - } - if (item.list) { - body += ` * ${item.list.join('\n\n * ')}`; - body += '\n\n'; - } - } - }); - return { - date: json.date, - locale: 'en-us', - revision: 1, - body - }; - } -}; diff --git a/src/Powercord/plugins/pc-updater/manifest.json b/src/Powercord/plugins/pc-updater/manifest.json deleted file mode 100644 index 07e89ba..0000000 --- a/src/Powercord/plugins/pc-updater/manifest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "Updater", - "version": "2.0.0", - "description": "Ensure Powercord, plugins and themes are always up to date", - "author": "Powercord Team", - "license": "MIT" -} diff --git a/src/Powercord/plugins/pc-updater/style.scss b/src/Powercord/plugins/pc-updater/style.scss deleted file mode 100644 index 55e7576..0000000 --- a/src/Powercord/plugins/pc-updater/style.scss +++ /dev/null @@ -1,211 +0,0 @@ -.powercord-updater { - .top-section { - margin-top: 35px; - display: flex; - - .icon { - width: 64px; - margin-right: 15px; - flex-shrink: 0; - } - - .animated path + path { - transform-origin: 50% 50%; - animation: rotate 1.2s infinite; - } - - @keyframes rotate { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } - } - - .status { - display: flex; - flex-direction: column; - justify-content: space-evenly; - - h3 { - font-size: 28px; - } - - div { - opacity: .7; - } - } - - .about { - display: flex; - margin-left: auto; - flex-direction: column; - justify-content: space-evenly; - font-family: SourceCodePro, Consolas, Liberation Mono, Menlo, Courier, monospace; - font-size: 14px; - opacity: .7; - - div { - display: flex; - justify-content: space-between; - - span { - margin-left: 10px; - width: 80px; - } - } - } - } - - .buttons { - display: flex; - margin-top: 25px; - - button + button { - margin-left: 15px; - } - } - - .updates { - margin-top: 25px; - } - - .update { - margin: 15px 0; - - .title { - display: flex; - align-items: center; - - .icon { - width: 28px; - height: 28px; - margin-right: 10px; - } - - .name { - font-size: 22px; - } - - .actions { - display: flex; - align-items: center; - margin-left: auto; - - button { - height: 26px; - min-height: 26px; - padding: 2px 6px; - - &:not(:last-child) { - margin-right: 10px; - } - } - } - } - - .summary { - padding: 10px 55px; - - div { - margin-bottom: 10px; - } - - a { - background-color: var(--background-secondary); - margin-right: 10px; - } - } - } - - .buttons, .update { - padding-bottom: 15px; - margin-bottom: 20px; - border-bottom: 1px var(--background-modifier-accent) solid; - } - - &-ft { - margin-top: 40px; - margin-bottom: 8px; - } - - .debug-info { - display: flex; - color: var(--interactive-normal); - user-select: text; - cursor: text; - - &.copied b { - color: #3ca374; - } - - code { - white-space: pre-wrap; - font-family: inherit; - font-size: 12px; - } - - b { - align-items: center; - color: #7289da; - text-transform: uppercase; - display: flex; - - &::after { - content: ""; - margin-left: 4px; - border: thin dashed; - opacity: .6; - flex: 1; - } - - transition: color .2s ease; - } - - .row { - display: flex; - flex-direction: row; - flex-wrap: wrap; - margin: 8px 0 8px 20px; - } - - .column { - flex-basis: 25%; - - &:nth-child(n+5) { - margin-top: 8px; - } - } - - .full-column { - flex-basis: 100%; - - &:nth-child(n+2) { - margin-top: 8px; - } - - &> a { - user-select: none; - } - } - - &:hover { - button { - opacity: 1; - } - } - - :last-child:not(button) > :last-child { - flex-basis: 85%; - } - - button { - opacity: 0; - align-self: flex-end; - transition: opacity .2s ease; - position: absolute; - right: 20px; - } - } -}