Changeset View
Changeset View
Standalone View
Standalone View
assets/js/app.js
Show All 18 Lines | |||||
// paths "./socket" or full ones "web/static/js/socket". | // paths "./socket" or full ones "web/static/js/socket". | ||||
import KolabChat from "./api" | import KolabChat from "./api" | ||||
// Initialize KolabChat API object | // Initialize KolabChat API object | ||||
let chat = new KolabChat({ | let chat = new KolabChat({ | ||||
userListElement: "userlist", | userListElement: "userlist", | ||||
userStatusElement: "userstatus", | userStatusElement: "userstatus", | ||||
channelListElement: "channellist", | |||||
chatRoomElement: "chat_txt", | chatRoomElement: "chat_txt", | ||||
chatDetailsElement: "chat_details", | |||||
chatInputElement: "chat_txt_input" | chatInputElement: "chat_txt_input" | ||||
}) | }) | ||||
// If user is authenticated start the app | // If user is authenticated start the app | ||||
if (window.userToken) { | if (window.userToken) { | ||||
chat.init({ | chat.init({ | ||||
token: window.userToken, | token: window.userToken, | ||||
roomId: window.roomId, | roomId: window.roomId, | ||||
invitees: window.invitees | invitees: window.invitees | ||||
}) | }) | ||||
} | } |