update translations

fix some more stuff
fix some themes
This commit is contained in:
HF 2021-04-30 00:41:29 +02:00
parent 8f0ec19999
commit 59f7c4b85b
22 changed files with 1265 additions and 1131 deletions

1106
i18n/de.po

File diff suppressed because it is too large Load Diff

View File

@ -290,6 +290,21 @@ msgstr ""
msgid "Server error occured" msgid "Server error occured"
msgstr "" msgstr ""
#: src/routes/api/auth/verify.js:25
#: src/routes/api/auth/verify.js:32
msgid "Mail verification"
msgstr ""
#: src/routes/api/auth/verify.js:26
msgid "You are now verified :)"
msgstr ""
#: src/routes/api/auth/verify.js:32
msgid ""
"Your mail verification code is invalid or already expired :(, please "
"request a new one."
msgstr ""
#: src/routes/api/auth/register.js:31 #: src/routes/api/auth/register.js:31
msgid "E-Mail already in use." msgid "E-Mail already in use."
msgstr "" msgstr ""
@ -306,21 +321,6 @@ msgstr ""
msgid "Failed to establish session after register :(" msgid "Failed to establish session after register :("
msgstr "" msgstr ""
#: src/routes/api/auth/verify.js:25
#: src/routes/api/auth/verify.js:32
msgid "Mail verification"
msgstr ""
#: src/routes/api/auth/verify.js:26
msgid "You are now verified :)"
msgstr ""
#: src/routes/api/auth/verify.js:32
msgid ""
"Your mail verification code is invalid or already expired :(, please "
"request a new one."
msgstr ""
#: src/routes/api/auth/logout.js:13 #: src/routes/api/auth/logout.js:13
msgid "You are not even logged in." msgid "You are not even logged in."
msgstr "" msgstr ""

File diff suppressed because it is too large Load Diff

View File

@ -815,7 +815,6 @@ export function hideAllWindowTypes(
windowType: string, windowType: string,
hide: boolean, hide: boolean,
): Action { ): Action {
console.log(`hideAllWindowTypes`, hide);
return { return {
type: 'HIDE_ALL_WINDOW_TYPE', type: 'HIDE_ALL_WINDOW_TYPE',
windowType, windowType,

View File

@ -66,7 +66,9 @@ function init() {
// assume that if one chat window is not hidden, all are // assume that if one chat window is not hidden, all are
let isRead = state.windows.showWindows let isRead = state.windows.showWindows
// eslint-disable-next-line max-len
&& state.windows.windows.find((win) => win.windowType === 'CHAT' && win.hidden === false) && state.windows.windows.find((win) => win.windowType === 'CHAT' && win.hidden === false)
// eslint-disable-next-line max-len
&& Object.values(state.windows.args).find((args) => args.chatChannel === channelId); && Object.values(state.windows.args).find((args) => args.chatChannel === channelId);
isRead = isRead || state.windows.modal.open isRead = isRead || state.windows.modal.open
&& state.windows.args[0].chatChannel === channelId; && state.windows.args[0].chatChannel === channelId;

View File

@ -33,14 +33,17 @@ const ChannelContextMenu = ({
useEffect(() => { useEffect(() => {
const handleClickOutside = (event) => { const handleClickOutside = (event) => {
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) { if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
event.stopPropagation();
close(); close();
} }
}; };
document.addEventListener('mousedown', handleClickOutside); document.addEventListener('click', handleClickOutside, {
document.addEventListener('touchstart', handleClickOutside); capture: true,
});
return () => { return () => {
document.removeEventListener('mousedown', handleClickOutside); document.removeEventListener('click', handleClickOutside, {
document.removeEventListener('touchstart', handleClickOutside); capture: true,
});
}; };
}, [wrapperRef]); }, [wrapperRef]);

View File

@ -42,6 +42,7 @@ const ChannelDropDown = ({
&& !wrapperRef.current.contains(event.target) && !wrapperRef.current.contains(event.target)
&& !buttonRef.current.contains(event.target) && !buttonRef.current.contains(event.target)
) { ) {
event.stopPropagation();
setShow(false); setShow(false);
} }
}, []); }, []);
@ -56,12 +57,14 @@ const ChannelDropDown = ({
const chType = (channels[chatChannel][1] === 1) ? 1 : 0; const chType = (channels[chatChannel][1] === 1) ? 1 : 0;
setType(chType); setType(chType);
} }
document.addEventListener('mousedown', handleClickOutside); document.addEventListener('click', handleClickOutside, {
document.addEventListener('touchstart', handleClickOutside); capture: true,
});
window.addEventListener('resize', handleWindowResize); window.addEventListener('resize', handleWindowResize);
} else { } else {
document.removeEventListener('mousedown', handleClickOutside); document.removeEventListener('click', handleClickOutside, {
document.removeEventListener('touchstart', handleClickOutside); capture: true,
});
window.removeEventListener('resize', handleWindowResize); window.removeEventListener('resize', handleWindowResize);
} }
}, [show]); }, [show]);

View File

@ -23,11 +23,11 @@ import {
*/ */
const selectChatWindowStatus = (state) => [ const selectChatWindowStatus = (state) => [
state.windows.showWindows, state.windows.showWindows,
state.windows.windows.find((win) => win.windowType === 'CHAT' && win.hidden === false) || ( state.windows.windows.find((win) => win.windowType === 'CHAT'
state.windows.modal.open && win.hidden === false)
&& state.windows.modal.windowType === 'CHAT' || (state.windows.modal.open && state.windows.modal.windowType === 'CHAT'),
), state.windows.windows.find((win) => win.windowType === 'CHAT'
state.windows.windows.find((win) => win.windowType === 'CHAT' && win.hidden === true), && win.hidden === true),
]; ];
const ChatButton = () => { const ChatButton = () => {
@ -42,8 +42,10 @@ const ChatButton = () => {
const chatNotify = useSelector((state) => state.audio.chatNotify); const chatNotify = useSelector((state) => state.audio.chatNotify);
const channels = useSelector((state) => state.chat.channels); const channels = useSelector((state) => state.chat.channels);
const [unread, mute] = useSelector((state) => [state.chatRead.unread, state.chatRead.mute], const [unread, mute] = useSelector((state) => [
shallowEqual); state.chatRead.unread,
state.chatRead.mute,
], shallowEqual);
/* /*
* almost the same as in ChannelDropDown * almost the same as in ChannelDropDown

View File

@ -32,14 +32,17 @@ const UserContextMenu = () => {
useEffect(() => { useEffect(() => {
const handleClickOutside = (event) => { const handleClickOutside = (event) => {
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) { if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
event.stopPropagation();
close(); close();
} }
}; };
document.addEventListener('mousedown', handleClickOutside); document.addEventListener('click', handleClickOutside, {
document.addEventListener('touchstart', handleClickOutside); capture: true,
});
return () => { return () => {
document.removeEventListener('mousedown', handleClickOutside); document.removeEventListener('click', handleClickOutside, {
document.removeEventListener('touchstart', handleClickOutside); capture: true,
});
}; };
}, [wrapperRef]); }, [wrapperRef]);

View File

@ -7,6 +7,7 @@ import React, {
useState, useCallback, useRef, useEffect, useState, useCallback, useRef, useEffect,
} from 'react'; } from 'react';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import { t } from 'ttag';
import { import {
moveWindow, moveWindow,
@ -20,6 +21,7 @@ import {
import useDrag from './hooks/drag'; import useDrag from './hooks/drag';
import COMPONENTS from './windows'; import COMPONENTS from './windows';
// eslint-disable-next-line max-len
const selectWindowById = (state, windowId) => state.windows.windows.find((win) => win.windowId === windowId); const selectWindowById = (state, windowId) => state.windows.windows.find((win) => win.windowId === windowId);
const Window = ({ id }) => { const Window = ({ id }) => {
@ -46,27 +48,33 @@ const Window = ({ id }) => {
dispatch(closeWindow(id)); dispatch(closeWindow(id));
}; };
useDrag(
titleBarRef,
focus,
useCallback((xDiff, yDiff) => dispatch(moveWindow(id, xDiff, yDiff)), []),
);
useDrag(
resizeRef,
focus,
useCallback((xDiff, yDiff) => dispatch(resizeWindow(id, xDiff, yDiff)), []),
);
const { const {
width, height, width, height,
xPos, yPos, xPos, yPos,
windowType, windowType,
title, title,
open, open,
hidden,
} = win; } = win;
useDrag(
titleBarRef,
focus,
useCallback((xDiff, yDiff) => dispatch(moveWindow(id, xDiff, yDiff)),
[hidden]),
);
useDrag(
resizeRef,
focus,
useCallback((xDiff, yDiff) => dispatch(resizeWindow(id, xDiff, yDiff)),
[hidden]),
);
const onTransitionEnd = () => { const onTransitionEnd = () => {
if (hidden) {
setRender(false);
}
if (!open) { if (!open) {
dispatch(removeWindow(id)); dispatch(removeWindow(id));
} }
@ -74,17 +82,21 @@ const Window = ({ id }) => {
useEffect(() => { useEffect(() => {
window.setTimeout(() => { window.setTimeout(() => {
if (open) setRender(true); if (open && !hidden) setRender(true);
}, 10); }, 10);
}, [open]); }, [open, hidden]);
const Content = COMPONENTS[windowType]; const Content = COMPONENTS[windowType];
console.log(`render window ${id}`); if (!render && hidden) {
return null;
}
return ( return (
<div <div
className={`window ${windowType}${(open && render) ? ' show' : ''}`} className={`window ${windowType}${
(open && !hidden && render) ? ' show' : ''
}`}
onTransitionEnd={onTransitionEnd} onTransitionEnd={onTransitionEnd}
onClick={focus} onClick={focus}
style={{ style={{
@ -100,30 +112,35 @@ const Window = ({ id }) => {
<span <span
className="win-topbtn" className="win-topbtn"
onClick={clone} onClick={clone}
title={t`Clone`}
> >
+ +
</span> </span>
<span <span
className="win-title" className="win-title"
ref={titleBarRef} ref={titleBarRef}
title={t`Move`}
> >
{title} {title}
</span> </span>
<span <span
className="win-topbtn" className="win-topbtn"
onClick={maximize} onClick={maximize}
title={t`Maximize`}
> >
</span> </span>
<span <span
className="win-topbtn" className="win-topbtn close"
onClick={close} onClick={close}
title={t`Close`}
> >
X X
</span> </span>
</div> </div>
<div <div
className="win-resize" className="win-resize"
title={t`Resize`}
ref={resizeRef} ref={resizeRef}
> >

View File

@ -8,6 +8,7 @@ import { useSelector, shallowEqual } from 'react-redux';
import Window from './Window'; import Window from './Window';
// eslint-disable-next-line max-len
const selectWindowIds = (state) => state.windows.windows.map((win) => win.windowId); const selectWindowIds = (state) => state.windows.windows.map((win) => win.windowId);
const WindowsRoot = () => { const WindowsRoot = () => {

View File

@ -16,7 +16,6 @@ function useDrag(elRef, startHandler, diffHandler) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
startHandler(); startHandler();
console.log('startDrag');
let { let {
clientX: startX, clientX: startX,
@ -29,7 +28,6 @@ function useDrag(elRef, startHandler, diffHandler) {
clientX: curX, clientX: curX,
clientY: curY, clientY: curY,
} = evt.touches ? evt.touches[0] : evt; } = evt.touches ? evt.touches[0] : evt;
console.log(`drag by ${curX - startX} - ${curY - startY}`);
diffHandler(curX - startX, curY - startY); diffHandler(curX - startX, curY - startY);
startX = curX; startX = curX;
startY = curY; startY = curY;
@ -39,7 +37,6 @@ function useDrag(elRef, startHandler, diffHandler) {
const stopDrag = (evt) => { const stopDrag = (evt) => {
evt.preventDefault(); evt.preventDefault();
evt.stopPropagation(); evt.stopPropagation();
console.log('stopDrag');
document.removeEventListener('mousemove', drag); document.removeEventListener('mousemove', drag);
document.removeEventListener('touchmove', drag); document.removeEventListener('touchmove', drag);
document.removeEventListener('mouseup', stopDrag); document.removeEventListener('mouseup', stopDrag);
@ -53,12 +50,18 @@ function useDrag(elRef, startHandler, diffHandler) {
useEffect(() => { useEffect(() => {
if (elRef && elRef.current) { if (elRef && elRef.current) {
elRef.current.addEventListener('mousedown', startDrag, { passive: false }); elRef.current.addEventListener('mousedown', startDrag, {
elRef.current.addEventListener('touchstart', startDrag, { passive: false }); passive: false,
});
elRef.current.addEventListener('touchstart', startDrag, {
passive: false,
});
} }
return () => { return () => {
elRef.current.removeEventListener('mousedown', startDrag); if (elRef && elRef.current) {
elRef.current.removeEventListener('touchstart', startDrag); elRef.current.removeEventListener('mousedown', startDrag);
elRef.current.removeEventListener('touchstart', startDrag);
}
}; };
}, [elRef, diffHandler]); }, [elRef, diffHandler]);
} }

View File

@ -44,10 +44,11 @@ const Chat = ({
), [dispatch]); ), [dispatch]);
const ownName = useSelector((state) => state.user.name); const ownName = useSelector((state) => state.user.name);
// eslint-disable-next-line max-len
const isDarkMode = useSelector((state) => state.gui.style.indexOf('dark') !== -1); const isDarkMode = useSelector((state) => state.gui.style.indexOf('dark') !== -1);
const fetching = useSelector((state) => state.fetching.fetchingChat); const fetching = useSelector((state) => state.fetching.fetchingChat);
const { channels, messages, blocked } = useSelector((state) => state.chat); const { channels, messages, blocked } = useSelector((state) => state.chat);
// eslint-disable-next-line max-len
const { chatChannel, inputMessage } = useSelector((state) => state.windows.args[windowId]); const { chatChannel, inputMessage } = useSelector((state) => state.windows.args[windowId]);
const { stayScrolled } = useStayScrolled(listRef, { const { stayScrolled } = useStayScrolled(listRef, {

View File

@ -227,7 +227,6 @@ class PixelPlainterControls {
onTouchStart(event: TouchEvent) { onTouchStart(event: TouchEvent) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
console.log('PixelPlainterControls touch start');
document.activeElement.blur(); document.activeElement.blur();
this.clickTapStartTime = Date.now(); this.clickTapStartTime = Date.now();
@ -258,7 +257,6 @@ class PixelPlainterControls {
onTouchEnd(event: TouchEvent) { onTouchEnd(event: TouchEvent) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
console.log('PixelPlainterControls touch end');
const { store } = this; const { store } = this;
if (event.touches.length === 0 && this.isClicking) { if (event.touches.length === 0 && this.isClicking) {
@ -295,7 +293,6 @@ class PixelPlainterControls {
onTouchMove(event: TouchEvent) { onTouchMove(event: TouchEvent) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
console.log('PixelPlainterControls touch move');
const multiTouch = (event.touches.length > 1); const multiTouch = (event.touches.length > 1);

View File

@ -32,19 +32,6 @@ export default function contextMenu(
const { const {
menuType, xPos, yPos, args, menuType, xPos, yPos, args,
} = action; } = action;
// if the same context menu is already open, close it
if (state.menuOpen && state.menuType === menuType
&& !(
Object.keys(state.args).length === Object.keys(args).length
&& Object.keys(state.args).every(
(key) => state.args[key] === args[key],
)
)) {
return {
...state,
menuOpen: false,
};
}
return { return {
...state, ...state,
menuType, menuType,

View File

@ -97,6 +97,12 @@ export default function windows(
}; };
} }
const windowId = generateWindowId(state); const windowId = generateWindowId(state);
const {
innerWidth: screenWidth,
innerHeight: screenHeight,
} = window;
const width = Math.min(550, Math.floor(screenWidth * 0.75));
const height = Math.min(300, Math.floor(screenHeight * 0.75));
return { return {
...state, ...state,
windows: [ windows: [
@ -107,10 +113,10 @@ export default function windows(
open: true, open: true,
hidden: false, hidden: false,
title, title,
width: 600, width,
height: 300, height,
xPos: 200, xPos: Math.floor((screenWidth - width) / 2),
yPos: 200, yPos: Math.floor((screenHeight - height) / 2),
cloneable, cloneable,
}, },
], ],
@ -203,7 +209,6 @@ export default function windows(
windowType, windowType,
hide, hide,
} = action; } = action;
console.log(`hideAllWindowTypes`, windowType, hide);
const newWindows = state.windows.map((win) => { const newWindows = state.windows.map((win) => {
if (win.windowType !== windowType) return win; if (win.windowType !== windowType) return win;
return { return {
@ -267,7 +272,6 @@ export default function windows(
) { ) {
return state; return state;
} }
console.log(`focus window ${windowId}`);
const newWindows = oldWindows.filter((w) => w.windowId !== windowId); const newWindows = oldWindows.filter((w) => w.windowId !== windowId);
const win = oldWindows.find((w) => w.windowId === windowId); const win = oldWindows.find((w) => w.windowId === windowId);
if (win) { if (win) {
@ -306,6 +310,12 @@ export default function windows(
const windowId = generateWindowId(state); const windowId = generateWindowId(state);
const { windowType, title } = state.modal; const { windowType, title } = state.modal;
const cloneable = true; const cloneable = true;
const {
innerWidth: screenWidth,
innerHeight: screenHeight,
} = window;
const width = Math.min(550, Math.floor(screenWidth * 0.75));
const height = Math.min(300, Math.floor(screenHeight * 0.75));
return { return {
...state, ...state,
modal: { modal: {
@ -320,10 +330,10 @@ export default function windows(
open: true, open: true,
hidden: false, hidden: false,
title, title,
width: 600, width,
height: 300, height,
xPos: 200, xPos: Math.floor((screenWidth - width) / 2),
yPos: 200, yPos: Math.floor((screenHeight - height) / 2),
cloneable, cloneable,
}, },
], ],

View File

@ -129,7 +129,7 @@ tr:nth-child(even) {
.window { .window {
position: fixed; position: fixed;
background-color: rgba(226, 226, 226, 0.92); background-color: rgba(252, 252, 252, 0.95);
border: solid black; border: solid black;
border-width: thin; border-width: thin;
overflow: hidden; overflow: hidden;
@ -146,14 +146,22 @@ tr:nth-child(even) {
} }
.win-title { .win-title {
border: solid black;
border-width: thin;
background-color: #e8e8e8;
cursor: move; cursor: move;
flex-grow: 1; flex-grow: 1;
line-height: 19px; line-height: 17px;
height: 17px;
margin: 2px; margin: 2px;
padding-left: 10px; padding-left: 10px;
font-size: 15px; font-size: 15px;
} }
.win-title:hover {
background-color: #e4e4e4;
}
.win-topbtn { .win-topbtn {
border: solid black; border: solid black;
border-width: thin; border-width: thin;
@ -168,6 +176,14 @@ tr:nth-child(even) {
font-weight: bold; font-weight: bold;
} }
.win-topbtn:hover {
background-color: #d7d7d7;
}
.win-topbtn.close:hover {
background-color: #f29696;
}
.win-resize { .win-resize {
position: absolute; position: absolute;
bottom: -4px; bottom: -4px;

View File

@ -22,6 +22,10 @@ tr:nth-child(odd) {
color: #ff91a6; color: #ff91a6;
} }
.window {
background: linear-gradient(1deg,#61dcea ,#ffb1e1,#ecffec,#fff9b1,#61dcea);
}
.actionbuttons:hover, .menu > div:hover, .channeldd, .contextmenu { .actionbuttons:hover, .menu > div:hover, .channeldd, .contextmenu {
background: linear-gradient(160deg, #61dcea , #ffb1e1, #ecffec, #ffb1e1, #61dcea); background: linear-gradient(160deg, #61dcea , #ffb1e1, #ecffec, #ffb1e1, #61dcea);
} }

View File

@ -30,9 +30,25 @@ tr:nth-child(even) {
background-color: #505050; background-color: #505050;
} }
.chatbox { .window {
background-color: rgba(59, 59, 59, 0.8); background-color: rgba(59, 59, 59, 0.98);
border-radius: 8px; border-radius: 5px;
}
.win-title {
background-color: #c1c1c1;
}
.win-title:hover {
background-color: #dedede;
}
.win-topbtn {
background-color: #a6a4a4;
}
.win-topbtn:hover {
background-color: #8b8b8b;
} }
.channeldd, .contextmenu { .channeldd, .contextmenu {
@ -102,12 +118,12 @@ tr:nth-child(even) {
color: hsla(220, 100%, 95.3%, 0.6); color: hsla(220, 100%, 95.3%, 0.6);
} }
.ModalClose { .ModalClose, .ModalRestore {
background-color: #55555d; background-color: #55555d;
border-color: #dcddde; border-color: #dcddde;
} }
.ModalClose:hover { .ModalClose:hover, .ModalRestore:hover {
background-color: #6f6f75; background-color: #6f6f75;
} }

View File

@ -30,11 +30,28 @@ tr:nth-child(even) {
background-color: #505050; background-color: #505050;
} }
.chatbox { .window {
background-color: rgba(59, 59, 59, 0.8); background-color: rgba(59, 59, 59, 0.98);
border-radius: 4px; border-radius: 4px;
} }
.win-title {
background-color: #c1c1c1;
color: #8a5007;
}
.win-title:hover {
background-color: #dedede;
}
.win-topbtn {
background-color: #a6a4a4;
}
.win-topbtn:hover {
background-color: #8b8b8b;
}
.channeldd, .contextmenu { .channeldd, .contextmenu {
background-color: #353535; background-color: #353535;
color: #efefef; color: #efefef;
@ -106,12 +123,12 @@ tr:nth-child(even) {
color: hsla(220, 100%, 95.3%, 0.6); color: hsla(220, 100%, 95.3%, 0.6);
} }
.ModalClose { .ModalClose, .ModalRestore {
background-color: #55555d; background-color: #55555d;
border-color: #dcddde; border-color: #dcddde;
} }
.ModalClose:hover { .ModalClose:hover, .ModalRestore:hover {
background-color: #6f6f75; background-color: #6f6f75;
} }

View File

@ -30,8 +30,24 @@ tr:nth-child(even) {
background-color: #505050; background-color: #505050;
} }
.chatbox { .window {
background-color: rgba(59, 59, 59, 0.8); background-color: rgba(59, 59, 59, 0.98);
}
.win-title {
background-color: #c1c1c1;
}
.win-title:hover {
background-color: #dedede;
}
.win-topbtn {
background-color: #a6a4a4;
}
.win-topbtn:hover {
background-color: #8b8b8b;
} }
.actionbuttons, .coorbox, .onlinebox, .cooldownbox, .palettebox, #historyselect { .actionbuttons, .coorbox, .onlinebox, .cooldownbox, .palettebox, #historyselect {
@ -87,12 +103,12 @@ tr:nth-child(even) {
color: hsla(220, 100%, 95.3%, 0.6); color: hsla(220, 100%, 95.3%, 0.6);
} }
.ModalClose { .ModalClose, .ModalRestore {
background-color: #55555d; background-color: #55555d;
border-color: #dcddde; border-color: #dcddde;
} }
.ModalClose:hover { .ModalClose:hover, .ModalRestore:hover {
background-color: #6f6f75; background-color: #6f6f75;
} }

View File

@ -1,7 +1,11 @@
.chatbox, .channeldd, .contextmenu { .channeldd, .contextmenu {
border-radius: 8px; border-radius: 8px;
} }
.window {
border-radius: 5px;
}
.chntop { .chntop {
margin-top: 4px; margin-top: 4px;
} }