use react portals to move Embeds out of ChatMessages into parent

add barebone for window route
This commit is contained in:
HF 2022-08-12 20:51:17 +02:00
parent cccb49df43
commit ae1e259bab
9 changed files with 353 additions and 261 deletions

View File

@ -28,40 +28,40 @@ msgstr ""
msgid "You don't have access to this channel" msgid "You don't have access to this channel"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:431 #: src/core/ChatProvider.js:433
msgid "Your mail has to be verified in order to chat" msgid "Your mail has to be verified in order to chat"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:436 #: src/core/ChatProvider.js:438
msgid "You are permanently muted, join our guilded to apppeal the mute" msgid "You are permanently muted, join our guilded to apppeal the mute"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:441 #: src/core/ChatProvider.js:443
#, javascript-format #, javascript-format
msgid "You are muted for another ${ timeMin } minutes" msgid "You are muted for another ${ timeMin } minutes"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:443 #: src/core/ChatProvider.js:445
msgid "You are muted for another ${ muted } seconds" msgid "You are muted for another ${ muted } seconds"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:451 #: src/core/ChatProvider.js:453
msgid "Ow no! Spam protection decided to mute you" msgid "Ow no! Spam protection decided to mute you"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:462 #: src/core/ChatProvider.js:464
msgid "You can't send a message this long :(" msgid "You can't send a message this long :("
msgstr "" msgstr ""
#: src/core/ChatProvider.js:466 #: src/core/ChatProvider.js:468
msgid "Please use int channel" msgid "Please use int channel"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:472 #: src/core/ChatProvider.js:475
msgid "Your country is temporary muted from this chat channel" msgid "Your country is temporary muted from this chat channel"
msgstr "" msgstr ""
#: src/core/ChatProvider.js:480 #: src/core/ChatProvider.js:483
msgid "Stop flooding." msgid "Stop flooding."
msgstr "" msgstr ""
@ -236,33 +236,6 @@ msgstr ""
msgid "Submit" msgid "Submit"
msgstr "" msgstr ""
#: src/routes/api/captcha.js:20
msgid "No captcha text given"
msgstr ""
#: src/routes/api/captcha.js:25
msgid "No captcha id given"
msgstr ""
#: src/routes/api/auth/register.js:54
#: src/routes/api/captcha.js:44
msgid "You took too long, try again."
msgstr ""
#: src/routes/api/auth/register.js:57
#: src/routes/api/captcha.js:50
msgid "You failed your captcha"
msgstr ""
#: src/routes/api/auth/register.js:60
#: src/routes/api/captcha.js:56
msgid "Unknown Captcha Error"
msgstr ""
#: src/routes/api/captcha.js:63
msgid "Server error occured"
msgstr ""
#: src/utils/validation.js:17 #: src/utils/validation.js:17
msgid "Email can't be empty." msgid "Email can't be empty."
msgstr "" msgstr ""
@ -311,6 +284,33 @@ msgstr ""
msgid "Password must be shorter than 60 characters." msgid "Password must be shorter than 60 characters."
msgstr "" msgstr ""
#: src/routes/api/captcha.js:20
msgid "No captcha text given"
msgstr ""
#: src/routes/api/captcha.js:25
msgid "No captcha id given"
msgstr ""
#: src/routes/api/auth/register.js:54
#: src/routes/api/captcha.js:44
msgid "You took too long, try again."
msgstr ""
#: src/routes/api/auth/register.js:57
#: src/routes/api/captcha.js:50
msgid "You failed your captcha"
msgstr ""
#: src/routes/api/auth/register.js:60
#: src/routes/api/captcha.js:56
msgid "Unknown Captcha Error"
msgstr ""
#: src/routes/api/captcha.js:63
msgid "Server error occured"
msgstr ""
#: src/routes/api/modtools.js:53 #: src/routes/api/modtools.js:53
msgid "You are not logged in" msgid "You are not logged in"
msgstr "" msgstr ""

View File

@ -54,113 +54,109 @@ msgstr ""
msgid "Didn't get an answer from pixelplanet. Maybe try to refresh?" msgid "Didn't get an answer from pixelplanet. Maybe try to refresh?"
msgstr "" msgstr ""
#: src/ui/placePixel.js:195 #: src/ui/placePixel.js:196
msgid "Invalid Canvas" msgid "Invalid Canvas"
msgstr "" msgstr ""
#: src/ui/placePixel.js:196 #: src/ui/placePixel.js:197
msgid "This canvas doesn't exist" msgid "This canvas doesn't exist"
msgstr "" msgstr ""
#: src/ui/placePixel.js:199 #: src/ui/placePixel.js:200
#: src/ui/placePixel.js:203 #: src/ui/placePixel.js:204
#: src/ui/placePixel.js:207 #: src/ui/placePixel.js:208
msgid "Invalid Coordinates" msgid "Invalid Coordinates"
msgstr "" msgstr ""
#: src/ui/placePixel.js:200 #: src/ui/placePixel.js:201
msgid "x out of bounds" msgid "x out of bounds"
msgstr "" msgstr ""
#: src/ui/placePixel.js:204 #: src/ui/placePixel.js:205
msgid "y out of bounds" msgid "y out of bounds"
msgstr "" msgstr ""
#: src/ui/placePixel.js:208 #: src/ui/placePixel.js:209
msgid "z out of bounds" msgid "z out of bounds"
msgstr "" msgstr ""
#: src/ui/placePixel.js:211 #: src/ui/placePixel.js:212
msgid "Wrong Color" msgid "Wrong Color"
msgstr "" msgstr ""
#: src/ui/placePixel.js:212 #: src/ui/placePixel.js:213
msgid "Invalid color selected" msgid "Invalid color selected"
msgstr "" msgstr ""
#: src/ui/placePixel.js:215 #: src/ui/placePixel.js:216
msgid "Just for registered Users" msgid "Just for registered Users"
msgstr "" msgstr ""
#: src/ui/placePixel.js:216 #: src/ui/placePixel.js:217
msgid "You have to be logged in to place on this canvas" msgid "You have to be logged in to place on this canvas"
msgstr "" msgstr ""
#: src/ui/placePixel.js:219 #: src/ui/placePixel.js:220
msgid "Place more :)" msgid "Place more :)"
msgstr "" msgstr ""
#: src/ui/placePixel.js:221 #: src/ui/placePixel.js:222
msgid "You can not access this canvas yet. You need to place more pixels" msgid "You can not access this canvas yet. You need to place more pixels"
msgstr "" msgstr ""
#: src/ui/placePixel.js:224 #: src/ui/placePixel.js:225
msgid "Pixel protected!" msgid "Pixel protected!"
msgstr "" msgstr ""
#: src/ui/placePixel.js:232 #: src/ui/placePixel.js:233
msgid "Please prove that you are human" msgid "Please prove that you are human"
msgstr "" msgstr ""
#: src/ui/placePixel.js:236 #: src/ui/placePixel.js:237
msgid "No Proxies Allowed :(" msgid "No Proxies Allowed :("
msgstr "" msgstr ""
#: src/ui/placePixel.js:237 #: src/ui/placePixel.js:238
msgid "You are using a Proxy." msgid "You are using a Proxy."
msgstr "" msgstr ""
#: src/ui/placePixel.js:240 #: src/ui/placePixel.js:241
msgid "Not allowed" msgid "Not allowed"
msgstr "" msgstr ""
#: src/ui/placePixel.js:241 #: src/ui/placePixel.js:242
msgid "Just the Top10 of yesterday can place here" msgid "Just the Top10 of yesterday can place here"
msgstr "" msgstr ""
#: src/ui/placePixel.js:244 #: src/ui/placePixel.js:245
msgid "You are weird" msgid "You are weird"
msgstr "" msgstr ""
#: src/ui/placePixel.js:246 #: src/ui/placePixel.js:247
msgid "Server got confused by your pixels. Are you playing on multiple devices?" msgid "Server got confused by your pixels. Are you playing on multiple devices?"
msgstr "" msgstr ""
#: src/ui/placePixel.js:249 #: src/ui/placePixel.js:250
msgid "Banned" msgid "Banned"
msgstr "" msgstr ""
#: src/ui/placePixel.js:250 #: src/ui/placePixel.js:254
msgid "ban"
msgstr ""
#: src/ui/placePixel.js:253
msgid "Range Banned" msgid "Range Banned"
msgstr "" msgstr ""
#: src/ui/placePixel.js:254 #: src/ui/placePixel.js:255
msgid "Your Internet Provider is banned from playing this game" msgid "Your Internet Provider is banned from playing this game"
msgstr "" msgstr ""
#: src/ui/placePixel.js:257 #: src/ui/placePixel.js:258
msgid "Weird" msgid "Weird"
msgstr "" msgstr ""
#: src/ui/placePixel.js:258 #: src/ui/placePixel.js:259
msgid "Couldn't set Pixel" msgid "Couldn't set Pixel"
msgstr "" msgstr ""
#: src/ui/placePixel.js:263 #: src/ui/placePixel.js:264
#, javascript-format #, javascript-format
msgid "Error ${ retCode }" msgid "Error ${ retCode }"
msgstr "" msgstr ""
@ -173,28 +169,28 @@ msgstr ""
msgid "Can't render 3D canvas, do you have WebGL2 disabled?" msgid "Can't render 3D canvas, do you have WebGL2 disabled?"
msgstr "" msgstr ""
#: src/components/BanInfo.jsx:135 #: src/components/BanInfo.jsx:137
#: src/store/actions/index.js:16 #: src/store/actions/index.js:16
msgid "OK" msgid "OK"
msgstr "" msgstr ""
#: src/store/actions/index.js:626 #: src/store/actions/index.js:663
msgid "Register New Account" msgid "Register New Account"
msgstr "" msgstr ""
#: src/store/actions/index.js:633 #: src/store/actions/index.js:670
msgid "Restore my Password" msgid "Restore my Password"
msgstr "" msgstr ""
#: src/store/actions/index.js:640 #: src/store/actions/index.js:677
msgid "Welcome to PixelPlanet.fun" msgid "Welcome to PixelPlanet.fun"
msgstr "" msgstr ""
#: src/store/actions/index.js:646 #: src/store/actions/index.js:683
msgid "Look at past Canvases" msgid "Look at past Canvases"
msgstr "" msgstr ""
#: src/components/Converter.jsx:559 #: src/components/Converter.jsx:561
#: src/components/CoordinatesBox.jsx:31 #: src/components/CoordinatesBox.jsx:31
#: src/components/ModWatchtools.jsx:355 #: src/components/ModWatchtools.jsx:355
msgid "Copy to Clipboard" msgid "Copy to Clipboard"
@ -225,11 +221,6 @@ msgstr ""
msgid "Restore" msgid "Restore"
msgstr "" msgstr ""
#: src/components/buttons/CanvasSwitchButton.jsx:22
#: src/components/windows/index.js:19
msgid "Canvas Selection"
msgstr ""
#: src/store/actions/fetch.js:39 #: src/store/actions/fetch.js:39
msgid "You made too many requests" msgid "You made too many requests"
msgstr "" msgstr ""
@ -275,6 +266,19 @@ msgstr ""
msgid "Open Menu" msgid "Open Menu"
msgstr "" msgstr ""
#: src/components/buttons/CanvasSwitchButton.jsx:22
#: src/components/windows/index.js:19
msgid "Canvas Selection"
msgstr ""
#: src/components/HistorySelect.jsx:144
msgid "Loading"
msgstr ""
#: src/components/HistorySelect.jsx:145
msgid "Select Date above"
msgstr ""
#: src/components/Window.jsx:118 #: src/components/Window.jsx:118
msgid "Clone" msgid "Clone"
msgstr "" msgstr ""
@ -291,12 +295,16 @@ msgstr ""
msgid "Resize" msgid "Resize"
msgstr "" msgstr ""
#: src/components/HistorySelect.jsx:143 #: src/components/buttons/GlobeButton.jsx:34
msgid "Loading" msgid "Globe View"
msgstr "" msgstr ""
#: src/components/HistorySelect.jsx:144 #: src/components/buttons/PalselButton.jsx:30
msgid "Select Date above" msgid "Close Palette"
msgstr ""
#: src/components/buttons/PalselButton.jsx:30
msgid "Open Palette"
msgstr "" msgstr ""
#: src/components/BanInfo.jsx:76 #: src/components/BanInfo.jsx:76
@ -319,18 +327,6 @@ msgstr ""
msgid "Make Screenshot" msgid "Make Screenshot"
msgstr "" msgstr ""
#: src/components/buttons/GlobeButton.jsx:34
msgid "Globe View"
msgstr ""
#: src/components/buttons/PalselButton.jsx:30
msgid "Close Palette"
msgstr ""
#: src/components/buttons/PalselButton.jsx:30
msgid "Open Palette"
msgstr ""
#: src/components/windows/index.js:16 #: src/components/windows/index.js:16
msgid "Registration" msgid "Registration"
msgstr "" msgstr ""
@ -347,6 +343,14 @@ msgstr ""
msgid "Canvas Archive" msgid "Canvas Archive"
msgstr "" msgstr ""
#: src/components/BanInfo.jsx:67
msgid "You are banned. You think it is unjustifed? Check out the "
msgstr ""
#: src/components/BanInfo.jsx:77
msgid " on how to appeal."
msgstr ""
#: src/components/BanInfo.jsx:81 #: src/components/BanInfo.jsx:81
#: src/components/Captcha.jsx:77 #: src/components/Captcha.jsx:77
#: src/components/ChangeMail.jsx:72 #: src/components/ChangeMail.jsx:72
@ -360,28 +364,6 @@ msgstr ""
msgid "Error" msgid "Error"
msgstr "" msgstr ""
#: src/components/ChangeMail.jsx:93
#: src/components/ChangeName.jsx:70
#: src/components/ChangePassword.jsx:115
#: src/components/DeleteAccount.jsx:68
#: src/components/GlobalCaptcha.jsx:48
#: src/components/windows/ForgotPassword.jsx:88
#: src/components/windows/Register.jsx:130
msgid "Cancel"
msgstr ""
#: src/components/GlobalCaptcha.jsx:55
msgid "Send"
msgstr ""
#: src/components/BanInfo.jsx:67
msgid "You are banned. You think it is unjustifed? Check out the "
msgstr ""
#: src/components/BanInfo.jsx:77
msgid " on how to appeal."
msgstr ""
#: src/components/BanInfo.jsx:86 #: src/components/BanInfo.jsx:86
#: src/components/ModIIDtools.jsx:72 #: src/components/ModIIDtools.jsx:72
msgid "Reason" msgid "Reason"
@ -412,10 +394,40 @@ msgstr ""
msgid "Now that you have seen this message, you are no longer banned." msgid "Now that you have seen this message, you are no longer banned."
msgstr "" msgstr ""
#: src/components/BanInfo.jsx:125 #: src/components/BanInfo.jsx:128
msgid "Why?" msgid "Why?"
msgstr "" msgstr ""
#: src/components/ChangeMail.jsx:93
#: src/components/ChangeName.jsx:70
#: src/components/ChangePassword.jsx:115
#: src/components/DeleteAccount.jsx:68
#: src/components/GlobalCaptcha.jsx:47
#: src/components/windows/ForgotPassword.jsx:88
#: src/components/windows/Register.jsx:130
msgid "Cancel"
msgstr ""
#: src/components/GlobalCaptcha.jsx:53
msgid "Send"
msgstr ""
#: src/components/contextmenus/UserContextMenu.jsx:56
msgid "Ping"
msgstr ""
#: src/components/contextmenus/UserContextMenu.jsx:83
msgid "DM"
msgstr ""
#: src/components/contextmenus/UserContextMenu.jsx:93
msgid "Block"
msgstr ""
#: src/components/contextmenus/ChannelContextMenu.jsx:54
msgid "Mute"
msgstr ""
#: src/components/windows/Help.jsx:42 #: src/components/windows/Help.jsx:42
msgid "Place color pixels on a large canvas with other players online!" msgid "Place color pixels on a large canvas with other players online!"
msgstr "" msgstr ""
@ -653,7 +665,7 @@ msgstr ""
msgid "For when you are playing on a potato." msgid "For when you are playing on a potato."
msgstr "" msgstr ""
#: src/components/Converter.jsx:374 #: src/components/Converter.jsx:376
#: src/components/windows/Settings.jsx:196 #: src/components/windows/Settings.jsx:196
msgid "Light Grid" msgid "Light Grid"
msgstr "" msgstr ""
@ -682,27 +694,28 @@ msgstr ""
msgid "Select Language" msgid "Select Language"
msgstr "" msgstr ""
#: src/components/windows/UserArea.jsx:36 #: src/components/windows/UserArea.jsx:29
#: src/components/windows/UserArea.jsx:48
msgid "Profile" msgid "Profile"
msgstr "" msgstr ""
#: src/components/windows/UserArea.jsx:39 #: src/components/windows/UserArea.jsx:51
msgid "Ranking" msgid "Ranking"
msgstr "" msgstr ""
#: src/components/windows/UserArea.jsx:42 #: src/components/windows/UserArea.jsx:54
msgid "Converter" msgid "Converter"
msgstr "" msgstr ""
#: src/components/windows/UserArea.jsx:48 #: src/components/windows/UserArea.jsx:60
msgid "Modtools" msgid "Modtools"
msgstr "" msgstr ""
#: src/components/windows/UserArea.jsx:49 #: src/components/windows/UserArea.jsx:61
msgid "Loading..." msgid "Loading..."
msgstr "" msgstr ""
#: src/components/windows/UserArea.jsx:56 #: src/components/windows/UserArea.jsx:68
msgid "Consider joining us on Guilded:" msgid "Consider joining us on Guilded:"
msgstr "" msgstr ""
@ -740,10 +753,10 @@ msgstr ""
#: src/components/Admintools.jsx:152 #: src/components/Admintools.jsx:152
#: src/components/Admintools.jsx:236 #: src/components/Admintools.jsx:236
#: src/components/ModCanvastools.jsx:313 #: src/components/ModCanvastools.jsx:314
#: src/components/ModCanvastools.jsx:394 #: src/components/ModCanvastools.jsx:396
#: src/components/ModCanvastools.jsx:469 #: src/components/ModCanvastools.jsx:471
#: src/components/ModCanvastools.jsx:561 #: src/components/ModCanvastools.jsx:564
#: src/components/ModIIDtools.jsx:134 #: src/components/ModIIDtools.jsx:134
#: src/components/windows/ForgotPassword.jsx:86 #: src/components/windows/ForgotPassword.jsx:86
#: src/components/windows/Register.jsx:124 #: src/components/windows/Register.jsx:124
@ -794,19 +807,19 @@ msgid ""
"how the canvas was at that time." "how the canvas was at that time."
msgstr "" msgstr ""
#: src/components/windows/Chat.jsx:134 #: src/components/windows/Chat.jsx:146
msgid "Channel settings" msgid "Channel settings"
msgstr "" msgstr ""
#: src/components/windows/Chat.jsx:151 #: src/components/windows/Chat.jsx:163
msgid "Start chatting here" msgid "Start chatting here"
msgstr "" msgstr ""
#: src/components/windows/Chat.jsx:193 #: src/components/windows/Chat.jsx:203
msgid "Chat here" msgid "Chat here"
msgstr "" msgstr ""
#: src/components/windows/Chat.jsx:215 #: src/components/windows/Chat.jsx:225
msgid "You must be logged in to chat" msgid "You must be logged in to chat"
msgstr "" msgstr ""
@ -818,22 +831,6 @@ msgstr ""
msgid "Enter your mail address and we will send you a new password:" msgid "Enter your mail address and we will send you a new password:"
msgstr "" msgstr ""
#: src/components/contextmenus/UserContextMenu.jsx:56
msgid "Ping"
msgstr ""
#: src/components/contextmenus/UserContextMenu.jsx:81
msgid "DM"
msgstr ""
#: src/components/contextmenus/UserContextMenu.jsx:91
msgid "Block"
msgstr ""
#: src/components/contextmenus/ChannelContextMenu.jsx:54
msgid "Mute"
msgstr ""
#: src/components/Captcha.jsx:50 #: src/components/Captcha.jsx:50
#: src/components/Captcha.jsx:105 #: src/components/Captcha.jsx:105
msgid "Could not load captcha" msgid "Could not load captcha"
@ -999,15 +996,15 @@ msgstr ""
msgid "Social Settings" msgid "Social Settings"
msgstr "" msgstr ""
#: src/components/Rankings.jsx:27 #: src/components/Rankings.jsx:31
msgid "Total" msgid "Total"
msgstr "" msgstr ""
#: src/components/Rankings.jsx:35 #: src/components/Rankings.jsx:40
msgid "Daily" msgid "Daily"
msgstr "" msgstr ""
#: src/components/Rankings.jsx:39 #: src/components/Rankings.jsx:85
msgid "Ranking updates every 5 min. Daily rankings get reset at midnight UTC." msgid "Ranking updates every 5 min. Daily rankings get reset at midnight UTC."
msgstr "" msgstr ""
@ -1037,56 +1034,56 @@ msgstr ""
msgid "Choose Strategy" msgid "Choose Strategy"
msgstr "" msgstr ""
#: src/components/Converter.jsx:293 #: src/components/Converter.jsx:294
msgid "Serpentine" msgid "Serpentine"
msgstr "" msgstr ""
#: src/components/Converter.jsx:295 #: src/components/Converter.jsx:296
msgid "Minimum Color Distance" msgid "Minimum Color Distance"
msgstr "" msgstr ""
#: src/components/Converter.jsx:322 #: src/components/Converter.jsx:323
msgid "Calculate like GIMP" msgid "Calculate like GIMP"
msgstr "" msgstr ""
#: src/components/Converter.jsx:326 #: src/components/Converter.jsx:327
msgid "Choose Color Mode" msgid "Choose Color Mode"
msgstr "" msgstr ""
#: src/components/Converter.jsx:354 #: src/components/Converter.jsx:356
msgid "Add Grid (uncheck if you need a 1:1 template)" msgid "Add Grid (uncheck if you need a 1:1 template)"
msgstr "" msgstr ""
#: src/components/Converter.jsx:376 #: src/components/Converter.jsx:378
#: src/components/Converter.jsx:392 #: src/components/Converter.jsx:394
msgid "Offset" msgid "Offset"
msgstr "" msgstr ""
#: src/components/Converter.jsx:421 #: src/components/Converter.jsx:423
msgid "Scale Image" msgid "Scale Image"
msgstr "" msgstr ""
#: src/components/Converter.jsx:432 #: src/components/Converter.jsx:434
msgid "Width" msgid "Width"
msgstr "" msgstr ""
#: src/components/Converter.jsx:463 #: src/components/Converter.jsx:465
msgid "Height" msgid "Height"
msgstr "" msgstr ""
#: src/components/Converter.jsx:502 #: src/components/Converter.jsx:504
msgid "Keep Ratio" msgid "Keep Ratio"
msgstr "" msgstr ""
#: src/components/Converter.jsx:515 #: src/components/Converter.jsx:517
msgid "Anti Aliasing" msgid "Anti Aliasing"
msgstr "" msgstr ""
#: src/components/Converter.jsx:529 #: src/components/Converter.jsx:531
msgid "Reset" msgid "Reset"
msgstr "" msgstr ""
#: src/components/Converter.jsx:547 #: src/components/Converter.jsx:549
msgid "Download Template" msgid "Download Template"
msgstr "" msgstr ""
@ -1143,6 +1140,70 @@ msgstr ""
msgid "LogIn" msgid "LogIn"
msgstr "" msgstr ""
#: src/components/ChangePassword.jsx:21
msgid "Passwords do not match."
msgstr ""
#: src/components/ChangePassword.jsx:44
msgid "Changed Password successfully."
msgstr ""
#: src/components/ChangePassword.jsx:88
msgid "Old Password"
msgstr ""
#: src/components/ChangePassword.jsx:96
msgid "New Password"
msgstr ""
#: src/components/ChangePassword.jsx:103
msgid "Confirm New Password"
msgstr ""
#: src/components/UserMessages.jsx:28
msgid ""
"Please verify your mail address or your account could get deleted after a "
"few days."
msgstr ""
#: src/components/UserMessages.jsx:49
msgid "A new verification mail is getting sent to you."
msgstr ""
#: src/components/UserMessages.jsx:53
msgid "Click here to request a new verification mail."
msgstr ""
#: src/components/ChangeName.jsx:64
msgid "New Username"
msgstr ""
#: src/components/ChangeMail.jsx:59
msgid ""
"Changed Mail successfully. We sent you a verification mail, "
"please verify your new mail address."
msgstr ""
#: src/components/ChangeMail.jsx:87
msgid "New Mail"
msgstr ""
#: src/components/DeleteAccount.jsx:66
msgid "Yes, Delete My Account!"
msgstr ""
#: src/components/SocialSettings.jsx:37
msgid "Block all Private Messages"
msgstr ""
#: src/components/SocialSettings.jsx:55
msgid "Unblock Users"
msgstr ""
#: src/components/SocialSettings.jsx:80
msgid "You have no users blocked"
msgstr ""
#: src/components/ModCanvastools.jsx:174 #: src/components/ModCanvastools.jsx:174
msgid "Build image on canvas." msgid "Build image on canvas."
msgstr "" msgstr ""
@ -1188,51 +1249,51 @@ msgstr ""
msgid "File" msgid "File"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:278 #: src/components/ModCanvastools.jsx:279
msgid "Coordinates in X_Y format:" msgid "Coordinates in X_Y format:"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:318 #: src/components/ModCanvastools.jsx:319
msgid "Pixel Protection" msgid "Pixel Protection"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:320 #: src/components/ModCanvastools.jsx:321
msgid "" msgid ""
"Set protection of areas (if you need finer grained control, " "Set protection of areas (if you need finer grained control, "
"use protect with image upload and alpha layers)" "use protect with image upload and alpha layers)"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:340 #: src/components/ModCanvastools.jsx:342
#: src/components/ModCanvastools.jsx:415 #: src/components/ModCanvastools.jsx:417
#: src/components/ModCanvastools.jsx:499 #: src/components/ModCanvastools.jsx:502
#: src/components/ModWatchtools.jsx:168 #: src/components/ModWatchtools.jsx:168
msgid "Top-left corner" msgid "Top-left corner"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:358 #: src/components/ModCanvastools.jsx:360
#: src/components/ModCanvastools.jsx:433 #: src/components/ModCanvastools.jsx:435
#: src/components/ModCanvastools.jsx:517 #: src/components/ModCanvastools.jsx:520
#: src/components/ModWatchtools.jsx:186 #: src/components/ModWatchtools.jsx:186
msgid "Bottom-right corner" msgid "Bottom-right corner"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:400 #: src/components/ModCanvastools.jsx:402
msgid "Rollback to Date" msgid "Rollback to Date"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:402 #: src/components/ModCanvastools.jsx:404
msgid "Rollback an area of the canvas to a set date (00:00 UTC)" msgid "Rollback an area of the canvas to a set date (00:00 UTC)"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:475 #: src/components/ModCanvastools.jsx:477
msgid "Canvas Cleaner" msgid "Canvas Cleaner"
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:477 #: src/components/ModCanvastools.jsx:479
msgid "Apply a filter to clean trash in large canvas areas." msgid "Apply a filter to clean trash in large canvas areas."
msgstr "" msgstr ""
#: src/components/ModCanvastools.jsx:579 #: src/components/ModCanvastools.jsx:582
msgid "Stop Cleaner" msgid "Stop Cleaner"
msgstr "" msgstr ""
@ -1268,23 +1329,6 @@ msgstr ""
msgid "User Name" msgid "User Name"
msgstr "" msgstr ""
#: src/components/ModIIDtools.jsx:19
#: src/components/ModIIDtools.jsx:23
msgid "You must enter an IID"
msgstr ""
#: src/components/ModIIDtools.jsx:52
msgid "IID Actions"
msgstr ""
#: src/components/ModIIDtools.jsx:79
msgid "Enter Reason"
msgstr ""
#: src/components/ModIIDtools.jsx:96
msgid "(0 = infinite)"
msgstr ""
#: src/components/ModWatchtools.jsx:45 #: src/components/ModWatchtools.jsx:45
msgid "Interval is invalid" msgid "Interval is invalid"
msgstr "" msgstr ""
@ -1313,68 +1357,24 @@ msgstr ""
msgid "Get Users" msgid "Get Users"
msgstr "" msgstr ""
#: src/components/UserMessages.jsx:28 #: src/components/ModIIDtools.jsx:19
msgid "" msgid "You must enter a duration"
"Please verify your mail address or your account could get deleted after a "
"few days."
msgstr "" msgstr ""
#: src/components/UserMessages.jsx:49 #: src/components/ModIIDtools.jsx:23
msgid "A new verification mail is getting sent to you." msgid "You must enter an IID"
msgstr "" msgstr ""
#: src/components/UserMessages.jsx:53 #: src/components/ModIIDtools.jsx:52
msgid "Click here to request a new verification mail." msgid "IID Actions"
msgstr "" msgstr ""
#: src/components/ChangeName.jsx:64 #: src/components/ModIIDtools.jsx:79
msgid "New Username" msgid "Enter Reason"
msgstr "" msgstr ""
#: src/components/ChangePassword.jsx:21 #: src/components/ModIIDtools.jsx:96
msgid "Passwords do not match." msgid "(0 = infinite)"
msgstr ""
#: src/components/ChangePassword.jsx:44
msgid "Changed Password successfully."
msgstr ""
#: src/components/ChangePassword.jsx:88
msgid "Old Password"
msgstr ""
#: src/components/ChangePassword.jsx:96
msgid "New Password"
msgstr ""
#: src/components/ChangePassword.jsx:103
msgid "Confirm New Password"
msgstr ""
#: src/components/ChangeMail.jsx:59
msgid ""
"Changed Mail successfully. We sent you a verification mail, "
"please verify your new mail address."
msgstr ""
#: src/components/ChangeMail.jsx:87
msgid "New Mail"
msgstr ""
#: src/components/DeleteAccount.jsx:66
msgid "Yes, Delete My Account!"
msgstr ""
#: src/components/SocialSettings.jsx:37
msgid "Block all Private Messages"
msgstr ""
#: src/components/SocialSettings.jsx:55
msgid "Unblock Users"
msgstr ""
#: src/components/SocialSettings.jsx:79
msgid "You have no users blocked"
msgstr "" msgstr ""
#: src/components/windows/Help.jsx:15 #: src/components/windows/Help.jsx:15

View File

@ -1,4 +1,4 @@
import React from 'react'; import React, { useRef } from 'react';
import { useSelector, useDispatch } from 'react-redux'; import { useSelector, useDispatch } from 'react-redux';
import { showContextMenu } from '../store/actions'; import { showContextMenu } from '../store/actions';
@ -23,6 +23,7 @@ function ChatMessage({
const isDarkMode = useSelector( const isDarkMode = useSelector(
(state) => state.gui.style.indexOf('dark') !== -1, (state) => state.gui.style.indexOf('dark') !== -1,
); );
const refEmbed = useRef(null);
const isInfo = (name === 'info'); const isInfo = (name === 'info');
const isEvent = (name === 'event'); const isEvent = (name === 'event');
@ -43,7 +44,7 @@ function ChatMessage({
<li className="chatmsg"> <li className="chatmsg">
{(!isInfo && !isEvent) {(!isInfo && !isEvent)
&& ( && (
<div className="chathead"> <div className="chathead" key="ch">
<span className="chatname"> <span className="chatname">
<img <img
alt="" alt=""
@ -82,9 +83,10 @@ function ChatMessage({
</span> </span>
</div> </div>
)} )}
<div className={className}> <div className={className} key="cm">
<MarkdownParagraph pArray={pArray} /> <MarkdownParagraph refEmbed={refEmbed} pArray={pArray} />
</div> </div>
<div className="chatembed" ref={refEmbed} key="ce" />
</li> </li>
); );
} }

View File

@ -7,7 +7,7 @@ import MdLink from './MdLink';
import MdMention from './MdMention'; import MdMention from './MdMention';
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
export const MarkdownParagraph = React.memo(({ pArray }) => pArray.map((part) => { export const MarkdownParagraph = React.memo(({ pArray, refEmbed }) => pArray.map((part) => {
if (!Array.isArray(part)) { if (!Array.isArray(part)) {
return part; return part;
} }
@ -42,7 +42,7 @@ export const MarkdownParagraph = React.memo(({ pArray }) => pArray.map((part) =>
case 'img': case 'img':
case 'l': { case 'l': {
return ( return (
<MdLink href={part[2]} title={part[1]} /> <MdLink refEmbed={refEmbed} href={part[2]} title={part[1]} />
); );
} }
case '@': { case '@': {

View File

@ -4,6 +4,7 @@
* Links are assumed to start with protocol (http:// etc.) * Links are assumed to start with protocol (http:// etc.)
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import { HiArrowsExpand, HiStop } from 'react-icons/hi'; import { HiArrowsExpand, HiStop } from 'react-icons/hi';
import { getLinkDesc } from '../core/utils'; import { getLinkDesc } from '../core/utils';
@ -18,7 +19,7 @@ const titleAllowed = [
't.me', 't.me',
]; ];
const MdLink = ({ href, title }) => { const MdLink = ({ href, title, refEmbed }) => {
const [showEmbed, setShowEmbed] = useState(false); const [showEmbed, setShowEmbed] = useState(false);
const desc = getLinkDesc(href); const desc = getLinkDesc(href);
@ -87,7 +88,15 @@ const MdLink = ({ href, title }) => {
</span> </span>
</> </>
)} )}
{(showEmbed && embedAvailable) && <Embed url={href} />} {showEmbed && embedAvailable && (
(refEmbed)
? ReactDOM.createPortal(
<Embed url={href} />,
refEmbed.current,
) : (
<Embed url={href} />
)
)}
</> </>
); );
}; };

View File

@ -19,6 +19,7 @@ import api from './api';
import assets from './assets.json'; // eslint-disable-line import/no-unresolved import assets from './assets.json'; // eslint-disable-line import/no-unresolved
import { expressTTag } from '../core/ttag'; import { expressTTag } from '../core/ttag';
import generateGlobePage from '../ssr/Globe'; import generateGlobePage from '../ssr/Globe';
import generateWinPage from '../ssr/Win';
import generateMainPage from '../ssr/Main'; import generateMainPage from '../ssr/Main';
import { MONTH } from '../core/constants'; import { MONTH } from '../core/constants';
@ -105,7 +106,7 @@ const globeEtag = etag(
assets.globe.js.join('_'), assets.globe.js.join('_'),
{ weak: true }, { weak: true },
); );
router.get('/globe', async (req, res) => { router.get('/globe', (req, res) => {
res.set({ res.set({
'Cache-Control': `private, max-age=${15 * 60}`, // seconds 'Cache-Control': `private, max-age=${15 * 60}`, // seconds
'Content-Type': 'text/html; charset=utf-8', 'Content-Type': 'text/html; charset=utf-8',
@ -120,6 +121,28 @@ router.get('/globe', async (req, res) => {
res.status(200).send(generateGlobePage(req.lang)); res.status(200).send(generateGlobePage(req.lang));
}); });
//
// Windows (like chat pop-up etc.)
// -----------------------------------------------------------------------------
const winEtag = etag(
assets.win.js,
{ weak: true },
);
router.get('/win', async (req, res) => {
res.set({
'Cache-Control': `private, max-age=${15 * 60}`, // seconds
'Content-Type': 'text/html; charset=utf-8',
ETag: globeEtag,
});
if (req.headers['if-none-match'] === winEtag) {
res.status(304).end();
return;
}
res.status(200).send(generateWinPage(req.lang));
});
// //
// Main Page (react generated) // Main Page (react generated)
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -128,7 +151,7 @@ const indexEtag = etag(
{ weak: true }, { weak: true },
); );
router.get('/', async (req, res) => { router.get('/', (req, res) => {
res.set({ res.set({
'Cache-Control': `private, max-age=${15 * 60}`, // seconds 'Cache-Control': `private, max-age=${15 * 60}`, // seconds
'Content-Type': 'text/html; charset=utf-8', 'Content-Type': 'text/html; charset=utf-8',

51
src/ssr/Win.jsx Normal file
View File

@ -0,0 +1,51 @@
/*
* create html for Window page
*
*/
/* eslint-disable max-len */
import { getTTag } from '../core/ttag';
/* this will be set by webpack */
// eslint-disable-next-line import/no-unresolved
import assets from './assets.json';
import { ASSET_SERVER } from '../core/config';
/*
* generates string with html of globe page
* @param lang language code
* @return html of mainpage
*/
function generateWinPage(lang) {
const script = (assets[`win-${lang}`])
? assets[`win-${lang}`].js
: assets.win.js;
const { t } = getTTag(lang);
const html = `
<!doctype html>
<html lang="${lang}">
<head>
<meta charset="UTF-8" />
<title>${t`PixelPlanet.Fun Window`}</title>
<meta name="description" content="${t`PixelPlanet.Fun Windows`}" />
<meta name="google" content="nopagereadaloud" />
<meta name="theme-color" content="#cae3ff" />
<meta name="viewport"
content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"
/>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="apple-touch-icon.png" />
</head>
<body>
<script src="${ASSET_SERVER + script}"></script>
</body>
</html>
`;
return html;
}
export default generateWinPage;

5
src/win.js Normal file
View File

@ -0,0 +1,5 @@
/*
* Main Script for windows (pop-ups and stuff)
*/
console.log('hello');

View File

@ -64,6 +64,8 @@ export function buildWebpackClientConfig(
[path.resolve(__dirname, 'src', 'client.js')], [path.resolve(__dirname, 'src', 'client.js')],
[(locale !== 'default') ? `globe-${locale}` : 'globe']: [(locale !== 'default') ? `globe-${locale}` : 'globe']:
[path.resolve(__dirname, 'src', 'globe.js')], [path.resolve(__dirname, 'src', 'globe.js')],
[(locale !== 'default') ? `win-${locale}` : 'win']:
[path.resolve(__dirname, 'src', 'win.js')],
}, },
output: { output: {