A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
import { Controller } from "./controller/AbstractController"; import { UserModel } from "./model/UserModel" import { Model } from "./model/AbstractModel"; import { View } from "./view/AbstractView"; import { UserView } from "./view/UserView"; import { UserController } from "./controller/UserController"; import log from "loglevel"; import { ModelFactory } from "./model/ModelFactory"; import { ActiveUserViewModel } from "./viewmodel/ActiveUserViewModel"; import { ChatMessageViewModel } from "./viewmodel/ChatMessageViewModel"; import Handlebars from "handlebars";
log.setLevel("TRACE") // let userModel = new UserModel();
const userModel = ModelFactory.createModel("USER");
const userView = new UserView(userModel, 2); userModel.attach(userView); // userView.model
const userController = new UserController(userModel, userView); userModel.someBusinessMethod(5); log.info("hello");
const chatMessageViewModel= new ChatMessageViewModel();
const activeUserViewModel = new ActiveUserViewModel(); activeUserViewModel.userName = "some user"; activeUserViewModel.lastActive = new Date(); activeUserViewModel.online = true;
function someFunc(vm: ActiveUserViewModel): void { log.info(vm); }
someFunc(activeUserViewModel);
// @ts-ignore: Object is possibly 'null'.
var source = document.getElementById("msg_container_template").innerHTML;
var msgContainerTemplate = Handlebars.compile(source);
|