Skip to content

Commit

Permalink
fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
teeteeteeteetee committed Nov 25, 2023
1 parent dc954ae commit 340d5e1
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 36 deletions.
14 changes: 14 additions & 0 deletions assets/templates/manifest.template.xml.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/*
* File: manifest.template.xml.js
* Project: discord-rpc
* File Created: Thursday, 23rd November 2023 11:19:04 am
* Author: Tee ([email protected])
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 5:21:10 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Demon Cat
*/
const hosts = require("../../src/rpc_client-src/client.js")

const getHosts = (props) => {
Expand Down Expand Up @@ -40,6 +53,7 @@ const host = (props, key) =>
<CEFCommandLine>
<Parameter>--allow-file-access</Parameter>
<Parameter>--allow-file-access-from-files</Parameter>
<Parameter>--disable-application-cache</Parameter>
<Parameter>--enable-nodejs</Parameter>
<Parameter>--mixed-context</Parameter>
</CEFCommandLine>
Expand Down
2 changes: 1 addition & 1 deletion src/client-src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Last Modified: Saturday, 25th November 2023 5:18:22 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
Expand Down
9 changes: 5 additions & 4 deletions src/client-src/components/ConfigItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,28 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Last Modified: Saturday, 25th November 2023 4:45:34 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
*/
import React, { useEffect, useState } from "react";
import React, { useState } from "react";
import "../discord.css";

export default function ConfigItem({ title, template, group, config, setConfig }) {

const checkbox = (id) => {
if(Object.keys(config).length !== 0){
if(Object.keys(config).length > 0){
const [checked, setChecked] = useState(config[group][id].enabled)

return (
<div className="checkbox-container my-auto">
<input checked={checked} onChange={() => {
setChecked(!checked)
config[group][id].enabled = !checked
setConfig(config)
}} className="checkbox" id={id} type="checkbox" />

<div className="checkbox-visual outline-none border-none focus:ring-0">
<div></div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/client-src/components/Navigator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Last Modified: Saturday, 25th November 2023 4:18:43 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
Expand All @@ -16,7 +16,6 @@ import NavItem from "./NavItem";
import { FaDiscord, FaCog, FaGithub } from 'react-icons/fa'
import { VscDebugConsole } from 'react-icons/vsc'
import property from "../../../package.json"
import { openUrlInDefaultBrowser } from "..";
export default function Navigator({setState}) {

const [update, setUpdate] = useState(false)
Expand Down
4 changes: 1 addition & 3 deletions src/client-src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Last Modified: Saturday, 25th November 2023 5:12:42 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
*/

import { setConfiguration } from "../rpc_client-src/localstorage";


// import { rpcConfiguration, extensionConfiguration, hasProp, getConfiguration, setConfiguration } from "./configuration";
const csInterface = new CSInterface();

class Controller {
Expand Down
2 changes: 1 addition & 1 deletion src/client-src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Last Modified: Saturday, 25th November 2023 5:08:46 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
Expand Down
10 changes: 7 additions & 3 deletions src/client-src/page/Config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Last Modified: Saturday, 25th November 2023 5:12:00 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
Expand All @@ -15,14 +15,18 @@
import React, {useEffect, useState} from 'react';
import ConfigItem from '../components/ConfigItem'
import { dispatchEvent } from '..';
import { extensionConfigurationTemplate, getConfigurations, resetConfiguration, rpcConfigurationTemplate } from "../../rpc_client-src/localstorage"
import { extensionConfigurationTemplate, getConfigurations, resetConfiguration, rpcConfigurationTemplate, setConfiguration } from "../../rpc_client-src/localstorage"
function ResetConfig(){
dispatchEvent("com.tee.rpc.reset", {})
window.location.reload()
// resetConfiguration()
resetConfiguration()
}
function SaveConfig(config){
dispatchEvent("com.tee.rpc.config", config)
for (const [key, value] of Object.entries(config)){
console.log(key)
setConfiguration(key, value)
}
// window.location.reload()
console.log(config)
}
Expand Down
17 changes: 10 additions & 7 deletions src/client-src/page/Repository.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:53 pm
* Last Modified: Saturday, 25th November 2023 4:20:27 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Demon Cat
Expand Down Expand Up @@ -44,12 +44,15 @@ export default function Repository() {
<br />
<p>Version: {property.version}</p>
<p>Latest version: {latest}</p>
<a className='text-sm text-gray-400 cursor-pointer inline-flex items-center hover:underline' onClick={() => openURLInDefaultBrowser(`https://github.com/teeteeteeteetee/adobe-discord-rpc/releases/tag/${latest}`)}>
New version is ready!
<svg className="w-3 h-3 ms-2.5 rtl:rotate-[270deg]" aria-hidden="true" xmlns="http:https://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
<path stroke="currentColor" strokeLinecap='round' strokeLinejoin='round' strokeWidth={2} d="M15 11v4.833A1.166 1.166 0 0 1 13.833 17H2.167A1.167 1.167 0 0 1 1 15.833V4.167A1.166 1.166 0 0 1 2.167 3h4.618m4.447-2H17v5.768M9.111 8.889l7.778-7.778" />
</svg>
</a>

{update && (
<a className='text-sm text-gray-400 cursor-pointer inline-flex items-center hover:underline' onClick={() => openURLInDefaultBrowser(`https://github.com/teeteeteeteetee/adobe-discord-rpc/releases/tag/${latest}`)}>
New version is ready!
<svg className="w-3 h-3 ms-2.5 rtl:rotate-[270deg]" aria-hidden="true" xmlns="http:https://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">
<path stroke="currentColor" strokeLinecap='round' strokeLinejoin='round' strokeWidth={2} d="M15 11v4.833A1.166 1.166 0 0 1 13.833 17H2.167A1.167 1.167 0 0 1 1 15.833V4.167A1.166 1.166 0 0 1 2.167 3h4.618m4.447-2H17v5.768M9.111 8.889l7.778-7.778" />
</svg>
</a>
)}
</div>
<footer>
<p className='text-xs text-gray-600 pl-2'>made by tee</p>
Expand Down
28 changes: 14 additions & 14 deletions src/rpc_client-src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Thursday, 23rd November 2023 12:26:09 pm
* Last Modified: Saturday, 25th November 2023 4:22:50 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
Expand All @@ -18,55 +18,55 @@
module.exports = {
AEFT: {
name: 'After Effects',
id: '748568089939148832',
id: '748568089939148832'
},
AICY: {
name: 'InCopy',
id: '756139390924750859',
id: '756139390924750859'

},
AUDT: {
name: 'Audition',
id: '750462631176830977',
id: '750462631176830977'
},
DRWV: {
name: 'Dreamweaver',
id: '756169802766221502',
id: '756169802766221502'
},
FLPR: {
name: 'Animate',
id: '756143118604173384',
id: '756143118604173384'
},
IDSN: {
name: 'InDesign',
id: '753663267137912953',
id: '753663267137912953'
},
ILST: {
name: 'Illustrator',
id: '751430009716998144',
id: '751430009716998144'
},
PHSP: {
name: 'Photoshop',
id: '748586506888806460',
id: '748586506888806460'
},
PHXS: {
name: 'Photoshop',
id: '748586506888806460',
id: '748586506888806460'
},
PPRO: {
name: 'Premiere Pro',
id: '748580494324662353',
id: '748580494324662353'
},
PRLD: {
name: 'Prelude',
id: '756139699051036797',
id: '756139699051036797'
},
RUSH: {
name: 'Premiere Rush',
id: '756158973241196595',
id: '756158973241196595'
},
MEDIA_ENCODER: {
name: 'Media Encoder',
id: '756149565429776453',
id: '756149565429776453'
}
}
2 changes: 1 addition & 1 deletion src/rpc_client-src/localstorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Github: https://github.com/teeteeteeteetee
* Discord: Tee#0001
*
* Last Modified: Saturday, 25th November 2023 2:49:42 pm
* Last Modified: Saturday, 25th November 2023 4:52:55 pm
* Modified By: Tee ([email protected])
*
* Copyright (c) 2023 Tee, Stainless Love
Expand Down

0 comments on commit 340d5e1

Please sign in to comment.