Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://gitlab.com/taigaka/tangent
https://gitlab.com/taigaka/tangent
Last synced: 3 months ago
JSON representation
- Host: gitlab.com
- URL: https://gitlab.com/taigaka/tangent
- Owner: taigaka
- License: apache-2.0
- Created: 2019-05-15T19:01:54.763Z (over 5 years ago)
- Default Branch: master
- Last Synced: 2024-06-26T11:36:33.658Z (5 months ago)
- Stars: 10
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-matrix - Tangent
README
# tangent
### Simple matrix web chat
![Client](https://sanlox.dev/tangent/img/tanclient.png "Client")
### [Working example here](https://sanlox.dev/tangent/)
## Configs
### tan_room
matrix room to be joined on startupe.g. `!xxxxxxxxxxxxxxxxxx:matrix.org`
this has to be a room id, not a room alias
### tan_hs
address of the matrix homeservere.g. `https://matrix.homeserver.tld`
### tan_ns
namespace of the client-server apie.g. `/_matrix/client/r0/`
### tan_out
element to output data to### tan_in
element to take input from### tan_user
element to take username from### tan_pass
element to take password from### tan_guests
allow or disallow guest login### tan_limit
number of messages to load on startup## Functions
### tan_login()
login with data from tan_user and tan_passreceive and set tan_token to use for further actions
start tan_join() on successful login
### tan_guest();
create a guest account and login with itstart tan_join() on successful login
### tan_logout()
invalidate tan_token### tan_join()
join room set in tan_roomstart tan_sync() on successful join
### tan_sync()
on startup reiceive last messages of tan_room and set batchwith batch set listen to new messages in tan_room
send all received messages to tan_print() and rerun
### tan_send()
send value of tan_in to tan_room and clear field### tan_print()
print message to tan_out and scroll down## Extras
### Send messages via enter key
tan_in.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
tan_send();
}
});### Logout on page close
window.onbeforeunload = function() {
tan_logout();
};