|
@ -31,6 +31,7 @@ import { UserViewDeps } from "./view/UserViewDeps"; |
|
|
import { ChatViewDeps } from "./view/ChatViewDeps"; |
|
|
import { ChatViewDeps } from "./view/ChatViewDeps"; |
|
|
import { MarkDownItMarkDownService } from "./service/MarkDownItMarkDownService"; |
|
|
import { MarkDownItMarkDownService } from "./service/MarkDownItMarkDownService"; |
|
|
import { Sprintf } from "./singleton/Sprintf"; |
|
|
import { Sprintf } from "./singleton/Sprintf"; |
|
|
|
|
|
import { EncryptionServiceFactory } from "./service/EncryptionServiceFactory"; |
|
|
|
|
|
|
|
|
const usersListElement = document.getElementById('contacts-box'); |
|
|
const usersListElement = document.getElementById('contacts-box'); |
|
|
const userSearchButton = document.getElementById('user-search'); |
|
|
const userSearchButton = document.getElementById('user-search'); |
|
@ -84,7 +85,7 @@ const cvDeps: ChatViewDeps = { |
|
|
messageSendTemplate: TemplateFactory.getTemplate('msg_container_send_template'), |
|
|
messageSendTemplate: TemplateFactory.getTemplate('msg_container_send_template'), |
|
|
messageReceiveTemplate: TemplateFactory.getTemplate('msg_container_template'), |
|
|
messageReceiveTemplate: TemplateFactory.getTemplate('msg_container_template'), |
|
|
markdownService: new MarkDownItMarkDownService, |
|
|
markdownService: new MarkDownItMarkDownService, |
|
|
encryptionService: new SJCLEncryptionService |
|
|
|
|
|
|
|
|
encryptionService: EncryptionServiceFactory.getEncryptionService() |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
const chatView = new ChatView(cvDeps); |
|
|
const chatView = new ChatView(cvDeps); |
|
@ -109,7 +110,7 @@ var msgContainerTemplate = Handlebars.compile(source); |
|
|
|
|
|
|
|
|
JsonAPI.ACTIVE_USERS_GET + 'aef'; |
|
|
JsonAPI.ACTIVE_USERS_GET + 'aef'; |
|
|
|
|
|
|
|
|
const encryptionService: EncryptionService = new SJCLEncryptionService(); |
|
|
|
|
|
|
|
|
const encryptionService: EncryptionService = EncryptionServiceFactory.getEncryptionService(); |
|
|
let messageCipherDTO: MessageCipherDTO = encryptionService.encrypt("password", "data"); |
|
|
let messageCipherDTO: MessageCipherDTO = encryptionService.encrypt("password", "data"); |
|
|
console.log(encryptionService.decrypt("password", messageCipherDTO)); |
|
|
console.log(encryptionService.decrypt("password", messageCipherDTO)); |
|
|
|
|
|
|
|
|