Commit Graph

106 Commits

Author SHA1 Message Date
shockrah
c3d5c75cc0 messages rebind now work properly and sends message correctly,
Message constructor no longer incorrectly check message type
2021-03-12 23:16:06 -08:00
shockrah
c667f69d0e Fixing busted config adder thingy 2021-03-12 21:36:44 -08:00
shockrah
67575cda53 adding tsc to make build 2021-03-12 02:20:33 -08:00
shockrah
5b2e92da06 Caching is still being designed but it _will_ be written in typescript to a more well docc'ed api for everything else
+ Basically im doing this to straight up abuse
- Moving cache types + methods to their own module
2021-03-12 02:20:00 -08:00
shockrah
dc117ba02f Moving message type to types.ts 2021-03-11 17:22:22 -08:00
shockrah
d620d3cc61 New types module written with typescript to slowly start migrating code over to typescript
The main reason for this change is for writing more descriptive code
Such a change isn't impossible with JS but requires annoying doccing that  most dev environments don't really pick up on ever

Also the cache system is goingto be much more complex than anything else in this project so static compilation should help remove annoyances
2021-03-11 17:22:05 -08:00
shockrah
049e8aea82 Misc fixes
- I've no idea how to describe these but they're really not that important
2021-03-11 17:20:13 -08:00
shockrah
e4f6e71ac8 ! Fixing message box to look decent
- Moving Initialization code into src/init.js
2021-03-11 17:18:26 -08:00
shockrah
b5822cd3f1 Moving as much auth/initialization logic out of index.html
 New local push function in auth for push server buttons onto the dom
2021-03-09 15:36:55 -08:00
shockrah
911edd8114 Supporting content_type flag in messages properly now 2021-03-09 00:11:34 -08:00
shockrah
2fa1ec6f34 Async rewrite of entire module !
 Channels list now fully asynchronous
 html pusher is now its own function for cleanness
 New ANY_CHANNEL integer is supported by the backend for requesting all channels in one go instead of voice|text
 Removed more callback hell code
 JSDocs updated to reflect their respective function signatures
2021-03-09 00:10:59 -08:00
shockrah
7fede3b4e1 New css making channel buttons not ugly as hell
 Moving channels.list behind async call
 Moved server-name to top of dom to reduce clutter(i think)
2021-03-09 00:07:41 -08:00
shockrah
d8244388c2 Removing myself from callback hell slowly but surely
 Removing ipc calls reducing chance to shrek the drive
2021-03-08 19:53:14 -08:00
shockrah
ef0bc70f90 Complexity in auth.login by basically cutting it in half and throwing the bad half out
 auth.init is now the more complex site since it literally has 1 chance to fire
2021-03-08 19:51:57 -08:00
shockrah
c4e3fa72ce More comprehensive example user config
 Moving main.js to use more async code and make things a bit more homogeneous
2021-03-08 19:50:01 -08:00
shockrah
f14390f4bb Callback settings.add_server_to_config now in effect for people that don't want to fuck with config files 2021-03-07 23:54:57 -08:00
shockrah
0d888a4c63 More unused code that pull credentials out of an object
Like why was this here, it's literally just object[key_name]
2021-03-07 23:54:17 -08:00
shockrah
6cfb7e7e4d No more callback trickery with auth.init
 Even more fluff removed
 From this point forward the codebase is mature enough for slimming down fearlessly
2021-03-07 23:53:09 -08:00
shockrah
7d3325fdc6 ipcMain now uses handle instead of .on for
 config-request probably doesn't need to be async like at all
2021-03-07 23:51:51 -08:00
shockrah
ca68c61f3a Framework/Modal for settings coming together
 Changing inline script to now run in an async block
 No more callback hell, literally anything can be written with async/await or callbacks when appropos
2021-03-07 23:49:49 -08:00
shockrah
fd1bf41fec Message constructor now takes in username as a parameter and binds it to uname
 Removed some fluff
 New get_member endpoint handler for later
2021-03-07 13:50:48 -08:00
shockrah
784043fc89 Cleaned up channels list header/description
 Better scrollarea definition for messages area
 Logging http errors in catch statement on auth init
2021-03-07 13:47:41 -08:00
shockrah
8e6c90b3c4 Removing superflous css in some jquery
 Messages now has its own properly named type exposed for other modules to use if it's required
 New jquery calls in messages to actually populate the message box with the last 48 hours worth of messages
2021-03-05 17:48:59 -08:00
shockrah
231141221b Adding hooks to reqest channel messages
 DOM manipulation for channel buttons moved to new module
 Message hooks themselves still require actual implementation but
all the required fallbacks are there
2021-03-03 21:49:40 -08:00
shockrah
9bf4048313 Removing a bunch of bs that is no longer used 2021-03-03 16:31:01 -08:00
shockrah
080b2cc538 * update_channels_list now literally updates the channel list with the correct hooks
! Callback hooks are not featured yet but they are registered in the DOM
2021-03-03 16:29:59 -08:00
shockrah
25876f90e4 * Adapting auth module to new config structure
+ Explicit login route handler now in takes care of logging in to 1 specific domain on request

+ auth.init which just hits /login for all available servers it can find
2021-03-03 16:28:55 -08:00
shockrah
12c3d300ba * Updated html to receive /channel/list data
- Removing fluff from join modal
+ Setting up initial buttons in DOM for listing channels and pulling up menus and such
2021-03-03 16:27:06 -08:00
shockrah
143e6a1a77 Removing NODE_TLS_REJECT 2021-03-03 16:25:13 -08:00
shockrah
e4630199a6 Only using http in dev environments 2021-02-12 19:07:14 -08:00
shockrah
41bfd1cd89 Only building html with 200's in channel_list 2021-02-12 19:07:03 -08:00
shockrah
24a49663d2 dev_env environment var check 2021-02-12 18:13:24 -08:00
shockrah
d42c39d117 Hiding menu but not removing it anymore 2021-02-12 18:12:33 -08:00
shockrah
8fb0fdbeed Basic channel button css 2021-02-12 18:11:20 -08:00
shockrah
6904e8eb26 using env vars for some comfy defaults for development 2021-02-12 15:50:05 -08:00
shockrah
ec6701418c update-config ipc calls now using new cfg.update_config as backend 2021-02-11 22:27:15 -08:00
shockrah
316b5ad1fd get_channels now has nearly no logic in it
Doing this because there are other mechanisms in place to protect against bs JWT's which really just adds a ton of complexity to every function
2021-02-11 22:26:42 -08:00
shockrah
efb8aa94de creating a new jwt when open the app for earch server
May as well do this to keep jwt's fresh
2021-02-11 22:25:27 -08:00
shockrah
d7e57c0751 new func for requesting jwt tokens from a server 2021-02-11 22:18:54 -08:00
shockrah
687b514d0d Adding listener for update-config requests from the render proc 2021-02-11 22:18:22 -08:00
shockrah
51fa07158f Mutable config now 2021-02-11 16:20:05 -08:00
shockrah
94c36a7ce9 adding npm test command 2021-02-11 16:19:18 -08:00
shockrah
0c4c8e9b75 simple onClick listener for server buttons 2021-02-11 16:18:58 -08:00
shockrah
22998a8119 * Got no longer throws errors like mad, this leaves only our own errors to get thrown
* url parameter in Request is replace with domain, port & path
* params handled by gotjs
* body defaults to null and is only added with truth like values with allowGetBody protection
2021-02-11 16:18:36 -08:00
shockrah
23c732390d Starting a mega simple testing suite 2021-02-11 16:16:50 -08:00
shockrah
90563b3214 Updating packages to newest version and opting to use gotjs for requests 2021-02-11 15:08:06 -08:00
shockrah
1e6a9ac844 +Setting proper callbacks on
* Prefering server domains for get's in build_server_list

* Fixing jsdoc for new_node to not be garbage
2021-01-28 18:01:38 -08:00
shockrah
ac9668557b Testing out a new module for channels api hits 2021-01-28 17:56:40 -08:00
shockrah
91a4e06cb7 moving jwt and login related things to new auth module 2021-01-28 17:55:26 -08:00
shockrah
1b7092fd34 Simple request/response api to wrap 'got' calls away 2021-01-28 17:54:49 -08:00