master #6

Open
karimov-adel wants to merge 39 commits from master into adel_branch_2.0
3 changed files with 24 additions and 11 deletions
Showing only changes of commit 6813c6249d - Show all commits

View File

@ -76,13 +76,17 @@ iu9-ca-web-chat-admin-cli <server admin-control address> <command text> [<comman
`adduser <user nickname> <user name> <user password> <user bio>` - зарегистрировать пользователя сайта
`8` - остановить сервис
Если нужно ввести пробел или символ `\ ` в любое из этих полей, перед ними нужно поставить `\ `;
Если указать меньше полей, чем нужно, незаполненные поля станут пустыми строками.
Параметры конфигурации `config.lang.whitelist` и `config.lang.force-order` определяют на
какие языки будет локализован сервер, и какие переводы приоритетнее каких.
На данный момент поддерживаются
- `ru-RU`
- `en-US`
Все переводы хранятся в папке `assets/lang`.
# Список участников

View File

@ -13,7 +13,8 @@ body, html {
position: absolute;
width: 100%;
left: 0;
background-color: rgba(150, 0, 100, 50);
/*background-color: rgba(150, 0, 100, 50);*/
background-color: rgba(0, 0, 0, 0);
/*display: flex;*/
/*flex-direction: row;*/
/*justify-content: center;*/

View File

@ -18,7 +18,7 @@ let lastMsgId = -1;
let myRoleHere = null; // Dung local state updates should be updated first
// Would start with true if opened `/chat/<>`
let bumpedAtTheBottom = false;
let bumpedAtBottom = false;
// Hidden variable. When deletion window popup is active
// Persists from popup activation until popup deactivation
@ -27,6 +27,7 @@ let storeHiddenMsgIdForDeletionWin = -1;
// Positive in production, negative for debug
let softZoneSz = -150;
let chatPadding = 300;
let msgGap = 5;
const msgErased = pres.chat.msgErased;
function genSentBase(){
@ -75,16 +76,16 @@ function updateOffsetsUpToTop(){
for (let curMsg = anchoredMsg; curMsg >= visibleMsgSegStart; curMsg--){
updateOffsetOfVisibleMsg(curMsg, offset);
let height = visibleMessages.get(curMsg).container.offsetHeight;
offset += height + 5;
offset += height + msgGap;
}
return offset;
return offset - msgGap;
}
function updateOffsetsDown(){
let offset = offsetOfAnchor;
for (let curMsg = anchoredMsg + 1; curMsg <= visibleMsgSegEnd; curMsg++){
let height = visibleMessages.get(curMsg).container.offsetHeight;
offset -= (height + 5);
offset -= (height + msgGap);
updateOffsetOfVisibleMsg(curMsg, offset);
}
return offset;
@ -115,8 +116,9 @@ function updateOffsets(){
let [W, H] = getChatWgSz();
let lowestLowestPoint = isMissingBottomMsgHeap() ? lowestPoint - heightOfPreloadGhost(): lowestPoint;
let highestHighestPoint = isMissingTopMsgHeap() ? highestPoint + heightOfPreloadGhost() : highestPoint;
if (lowestLowestPoint > chatPadding || (highestHighestPoint - lowestLowestPoint) <= H - chatPadding * 2) {
bumpedAtTheBottom = true;
if (lowestLowestPoint > chatPadding || (highestHighestPoint - lowestLowestPoint) <= H - chatPadding * 2 ||
(!isMissingBottomMsgHeap() && bumpedAtBottom)) {
offsetOfAnchor += (-lowestLowestPoint + chatPadding);
updateOffsetsSane();
} else if (highestHighestPoint < H - chatPadding) {
@ -357,7 +359,7 @@ async function loadWhitespaceMultitry(){
do {
try {
await tryLoadWhitespaceSingle();
await sleep(100);
await sleep(1100);
} catch (e) {
console.error(e);
await sleep(1500);
@ -410,9 +412,13 @@ window.onload = function (){
console.log("Page was loaded");
document.body.addEventListener("wheel", function (event) {
// event.preventDefault();
bumpedAtTheBottom = false;
offsetOfAnchor += event.deltaY / 3;
let offset = event.deltaY / 3;
if (offset < 0){
bumpedAtBottom = false;
} else if (offset > 0 && !isMissingBottomMsgHeap() && lowestPoint + offset > chatPadding){
bumpedAtBottom = true;
}
offsetOfAnchor += offset;
updateOffsets();
loadWhitespaceMultitry().then(dopDopYesYes);
});
@ -430,6 +436,8 @@ window.onload = function (){
}
});
bumpedAtBottom = (openedchat.selectedMessageId < 0);
let chatWg = document.getElementById("chat-widget");
let chatWgDebugLinesFnc = function (){
let H = chatWg.offsetHeight;