From 2f1c4127953d55e53322e911c51cc29a1e4e549c Mon Sep 17 00:00:00 2001 From: mirzaev Date: Sat, 3 Feb 2024 23:48:35 +0700 Subject: [PATCH] servers registration --- .gitignore | 0 mirzaev/notchat/system/controllers/core.php | 0 mirzaev/notchat/system/controllers/index.php | 40 ++++- mirzaev/notchat/system/controllers/server.php | 62 ++++++++ .../system/controllers/traits/errors.php | 31 ++++ mirzaev/notchat/system/models/core.php | 10 +- mirzaev/notchat/system/models/server.php | 113 ++++++++++++++ mirzaev/notchat/system/public/index.php | 2 + mirzaev/notchat/system/public/js/adapter.js | 0 mirzaev/notchat/system/public/js/chats.js | 55 +++++++ mirzaev/notchat/system/public/js/core.js | 57 +++++++ mirzaev/notchat/system/public/js/notchat.js | 0 .../notchat/system/public/js/pages/chat.js | 7 + mirzaev/notchat/system/public/server.php | 0 .../public/themes/default/css/animations.css | 21 +++ .../public/themes/default/css/fonts.css | 9 ++ .../themes/default/css/fonts/dejavu.css | 34 +++++ .../public/themes/default/css/fonts/fira.css | 139 ++++++++++++++++++ .../public/themes/default/css/fonts/hack.css | 63 ++++++++ .../public/themes/default/css/icons/data.css | 51 +++++++ .../default => themes/default/css}/main.css | 37 ++++- .../themes/default/fonts/commissioner.ttf | Bin 0 -> 741344 bytes .../fonts/dejavu/DejaVuLGCSans-Bold.ttf | Bin 0 -> 585992 bytes .../dejavu/DejaVuLGCSans-BoldOblique.ttf | Bin 0 -> 559324 bytes .../fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf | Bin 0 -> 334872 bytes .../fonts/dejavu/DejaVuLGCSans-Oblique.ttf | Bin 0 -> 551040 bytes .../default/fonts/dejavu/DejaVuLGCSans.ttf | Bin 0 -> 622104 bytes .../dejavu/DejaVuLGCSansCondensed-Bold.ttf | Bin 0 -> 547172 bytes .../DejaVuLGCSansCondensed-BoldOblique.ttf | Bin 0 -> 528188 bytes .../dejavu/DejaVuLGCSansCondensed-Oblique.ttf | Bin 0 -> 515248 bytes .../fonts/dejavu/DejaVuLGCSansCondensed.ttf | Bin 0 -> 557768 bytes .../fonts/dejavu/DejaVuLGCSansMono-Bold.ttf | Bin 0 -> 282040 bytes .../dejavu/DejaVuLGCSansMono-BoldOblique.ttf | Bin 0 -> 227432 bytes .../dejavu/DejaVuLGCSansMono-Oblique.ttf | Bin 0 -> 227044 bytes .../fonts/dejavu/DejaVuLGCSansMono.ttf | Bin 0 -> 292700 bytes .../fonts/dejavu/DejaVuLGCSerif-Bold.ttf | Bin 0 -> 318112 bytes .../dejavu/DejaVuLGCSerif-BoldItalic.ttf | Bin 0 -> 305060 bytes .../fonts/dejavu/DejaVuLGCSerif-Italic.ttf | Bin 0 -> 307752 bytes .../default/fonts/dejavu/DejaVuLGCSerif.ttf | Bin 0 -> 345352 bytes .../dejavu/DejaVuLGCSerifCondensed-Bold.ttf | Bin 0 -> 293432 bytes .../DejaVuLGCSerifCondensed-BoldItalic.ttf | Bin 0 -> 304260 bytes .../dejavu/DejaVuLGCSerifCondensed-Italic.ttf | Bin 0 -> 307176 bytes .../fonts/dejavu/DejaVuLGCSerifCondensed.ttf | Bin 0 -> 311956 bytes .../default/fonts/fira/FiraMono-Bold.woff | Bin 0 -> 94732 bytes .../default/fonts/fira/FiraMono-Bold.woff2 | Bin 0 -> 70360 bytes .../default/fonts/fira/FiraMono-Medium.woff | Bin 0 -> 86160 bytes .../default/fonts/fira/FiraMono-Medium.woff2 | Bin 0 -> 64572 bytes .../default/fonts/fira/FiraMono-Regular.woff | Bin 0 -> 86572 bytes .../default/fonts/fira/FiraMono-Regular.woff2 | Bin 0 -> 64868 bytes .../default/fonts/fira/FiraSans-Bold.woff | Bin 0 -> 198080 bytes .../default/fonts/fira/FiraSans-Bold.woff2 | Bin 0 -> 140452 bytes .../fonts/fira/FiraSans-BoldItalic.woff | Bin 0 -> 209004 bytes .../fonts/fira/FiraSans-BoldItalic.woff2 | Bin 0 -> 148468 bytes .../default/fonts/fira/FiraSans-Book.woff | Bin 0 -> 185904 bytes .../default/fonts/fira/FiraSans-Book.woff2 | Bin 0 -> 131756 bytes .../fonts/fira/FiraSans-BookItalic.woff | Bin 0 -> 195408 bytes .../fonts/fira/FiraSans-BookItalic.woff2 | Bin 0 -> 138936 bytes .../default/fonts/fira/FiraSans-Eight.woff | Bin 0 -> 179116 bytes .../default/fonts/fira/FiraSans-Eight.woff2 | Bin 0 -> 126276 bytes .../fonts/fira/FiraSans-EightItalic.woff | Bin 0 -> 188976 bytes .../fonts/fira/FiraSans-EightItalic.woff2 | Bin 0 -> 133760 bytes .../fonts/fira/FiraSans-ExtraBold.woff | Bin 0 -> 200908 bytes .../fonts/fira/FiraSans-ExtraBold.woff2 | Bin 0 -> 141216 bytes .../fonts/fira/FiraSans-ExtraBoldItalic.woff | Bin 0 -> 212852 bytes .../fonts/fira/FiraSans-ExtraBoldItalic.woff2 | Bin 0 -> 151144 bytes .../fonts/fira/FiraSans-ExtraLight.woff | Bin 0 -> 182012 bytes .../fonts/fira/FiraSans-ExtraLight.woff2 | Bin 0 -> 128592 bytes .../fonts/fira/FiraSans-ExtraLightItalic.woff | Bin 0 -> 191176 bytes .../fira/FiraSans-ExtraLightItalic.woff2 | Bin 0 -> 135652 bytes .../default/fonts/fira/FiraSans-Four.woff | Bin 0 -> 174800 bytes .../default/fonts/fira/FiraSans-Four.woff2 | Bin 0 -> 123392 bytes .../fonts/fira/FiraSans-FourItalic.woff | Bin 0 -> 188024 bytes .../fonts/fira/FiraSans-FourItalic.woff2 | Bin 0 -> 132328 bytes .../default/fonts/fira/FiraSans-Hair.woff | Bin 0 -> 182312 bytes .../default/fonts/fira/FiraSans-Hair.woff2 | Bin 0 -> 128868 bytes .../fonts/fira/FiraSans-HairItalic.woff | Bin 0 -> 192788 bytes .../fonts/fira/FiraSans-HairItalic.woff2 | Bin 0 -> 136300 bytes .../default/fonts/fira/FiraSans-Heavy.woff | Bin 0 -> 200676 bytes .../default/fonts/fira/FiraSans-Heavy.woff2 | Bin 0 -> 139600 bytes .../fonts/fira/FiraSans-HeavyItalic.woff | Bin 0 -> 212700 bytes .../fonts/fira/FiraSans-HeavyItalic.woff2 | Bin 0 -> 149572 bytes .../default/fonts/fira/FiraSans-Italic.woff | Bin 0 -> 192184 bytes .../default/fonts/fira/FiraSans-Italic.woff2 | Bin 0 -> 136300 bytes .../default/fonts/fira/FiraSans-Light.woff | Bin 0 -> 182984 bytes .../default/fonts/fira/FiraSans-Light.woff2 | Bin 0 -> 129180 bytes .../fonts/fira/FiraSans-LightItalic.woff | Bin 0 -> 191400 bytes .../fonts/fira/FiraSans-LightItalic.woff2 | Bin 0 -> 135744 bytes .../default/fonts/fira/FiraSans-Medium.woff | Bin 0 -> 186824 bytes .../default/fonts/fira/FiraSans-Medium.woff2 | Bin 0 -> 132780 bytes .../fonts/fira/FiraSans-MediumItalic.woff | Bin 0 -> 197376 bytes .../fonts/fira/FiraSans-MediumItalic.woff2 | Bin 0 -> 140588 bytes .../default/fonts/fira/FiraSans-Regular.woff | Bin 0 -> 183268 bytes .../default/fonts/fira/FiraSans-Regular.woff2 | Bin 0 -> 129188 bytes .../default/fonts/fira/FiraSans-SemiBold.woff | Bin 0 -> 198128 bytes .../fonts/fira/FiraSans-SemiBold.woff2 | Bin 0 -> 140168 bytes .../fonts/fira/FiraSans-SemiBoldItalic.woff | Bin 0 -> 208040 bytes .../fonts/fira/FiraSans-SemiBoldItalic.woff2 | Bin 0 -> 147644 bytes .../default/fonts/fira/FiraSans-Thin.woff | Bin 0 -> 181896 bytes .../default/fonts/fira/FiraSans-Thin.woff2 | Bin 0 -> 128408 bytes .../fonts/fira/FiraSans-ThinItalic.woff | Bin 0 -> 190040 bytes .../fonts/fira/FiraSans-ThinItalic.woff2 | Bin 0 -> 134324 bytes .../default/fonts/fira/FiraSans-Two.woff | Bin 0 -> 171160 bytes .../default/fonts/fira/FiraSans-Two.woff2 | Bin 0 -> 120408 bytes .../fonts/fira/FiraSans-TwoItalic.woff | Bin 0 -> 180328 bytes .../fonts/fira/FiraSans-TwoItalic.woff2 | Bin 0 -> 126656 bytes .../default/fonts/fira/FiraSans-Ultra.woff | Bin 0 -> 212040 bytes .../default/fonts/fira/FiraSans-Ultra.woff2 | Bin 0 -> 148340 bytes .../fonts/fira/FiraSans-UltraItalic.woff | Bin 0 -> 225024 bytes .../fonts/fira/FiraSans-UltraItalic.woff2 | Bin 0 -> 158892 bytes .../fonts/fira/FiraSans-UltraLight.woff | Bin 0 -> 181508 bytes .../fonts/fira/FiraSans-UltraLight.woff2 | Bin 0 -> 128572 bytes .../fonts/fira/FiraSans-UltraLightItalic.woff | Bin 0 -> 189656 bytes .../fira/FiraSans-UltraLightItalic.woff2 | Bin 0 -> 134292 bytes .../default/fonts/hack/hack-bold-subset.woff | Bin 0 -> 30212 bytes .../default/fonts/hack/hack-bold-subset.woff2 | Bin 0 -> 23512 bytes .../themes/default/fonts/hack/hack-bold.woff | Bin 0 -> 144868 bytes .../themes/default/fonts/hack/hack-bold.woff2 | Bin 0 -> 108008 bytes .../fonts/hack/hack-bolditalic-subset.woff | Bin 0 -> 33668 bytes .../fonts/hack/hack-bolditalic-subset.woff2 | Bin 0 -> 26460 bytes .../default/fonts/hack/hack-bolditalic.woff | Bin 0 -> 151048 bytes .../default/fonts/hack/hack-bolditalic.woff2 | Bin 0 -> 113512 bytes .../fonts/hack/hack-italic-subset.woff | Bin 0 -> 32648 bytes .../fonts/hack/hack-italic-subset.woff2 | Bin 0 -> 25740 bytes .../default/fonts/hack/hack-italic.woff | Bin 0 -> 148532 bytes .../default/fonts/hack/hack-italic.woff2 | Bin 0 -> 111360 bytes .../fonts/hack/hack-regular-subset.woff | Bin 0 -> 29640 bytes .../fonts/hack/hack-regular-subset.woff2 | Bin 0 -> 23244 bytes .../default/fonts/hack/hack-regular.woff | Bin 0 -> 141132 bytes .../default/fonts/hack/hack-regular.woff2 | Bin 0 -> 106236 bytes ...4c8ddb05601cb26ef6c6c5c22bfa42a0763a8.json | 1 + mirzaev/notchat/system/views/templater.php | 0 .../system/views/themes/default/chat.html | 0 .../system/views/themes/default/chats.html | 2 + .../system/views/themes/default/core.html | 0 .../system/views/themes/default/footer.html | 0 .../system/views/themes/default/head.html | 4 +- .../system/views/themes/default/header.html | 0 .../system/views/themes/default/index.html | 2 - .../system/views/themes/default/js.html | 1 + .../themes/default/sections/servers.html | 22 +++ 140 files changed, 754 insertions(+), 9 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 mirzaev/notchat/system/controllers/core.php mode change 100644 => 100755 mirzaev/notchat/system/controllers/index.php create mode 100755 mirzaev/notchat/system/controllers/server.php create mode 100755 mirzaev/notchat/system/controllers/traits/errors.php mode change 100644 => 100755 mirzaev/notchat/system/models/core.php create mode 100755 mirzaev/notchat/system/models/server.php mode change 100644 => 100755 mirzaev/notchat/system/public/index.php mode change 100644 => 100755 mirzaev/notchat/system/public/js/adapter.js create mode 100755 mirzaev/notchat/system/public/js/chats.js create mode 100755 mirzaev/notchat/system/public/js/core.js mode change 100644 => 100755 mirzaev/notchat/system/public/js/notchat.js mode change 100644 => 100755 mirzaev/notchat/system/public/js/pages/chat.js mode change 100644 => 100755 mirzaev/notchat/system/public/server.php create mode 100755 mirzaev/notchat/system/public/themes/default/css/animations.css create mode 100755 mirzaev/notchat/system/public/themes/default/css/fonts.css create mode 100644 mirzaev/notchat/system/public/themes/default/css/fonts/dejavu.css create mode 100755 mirzaev/notchat/system/public/themes/default/css/fonts/fira.css create mode 100755 mirzaev/notchat/system/public/themes/default/css/fonts/hack.css create mode 100644 mirzaev/notchat/system/public/themes/default/css/icons/data.css rename mirzaev/notchat/system/public/{css/themes/default => themes/default/css}/main.css (81%) mode change 100644 => 100755 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/commissioner.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSans-Bold.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSans-BoldOblique.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSans-ExtraLight.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSans-Oblique.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSans.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansCondensed-Bold.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansCondensed-BoldOblique.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansCondensed-Oblique.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansCondensed.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansMono-Bold.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansMono-BoldOblique.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansMono-Oblique.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSansMono.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerif-Bold.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerif-BoldItalic.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerif-Italic.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerif.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerifCondensed-Bold.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerifCondensed-BoldItalic.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerifCondensed-Italic.ttf create mode 100644 mirzaev/notchat/system/public/themes/default/fonts/dejavu/DejaVuLGCSerifCondensed.ttf create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraMono-Bold.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraMono-Bold.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraMono-Medium.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraMono-Medium.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraMono-Regular.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraMono-Regular.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Bold.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Bold.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-BoldItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-BoldItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Book.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Book.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-BookItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-BookItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Eight.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Eight.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-EightItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-EightItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraBold.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraBold.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraBoldItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraBoldItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraLight.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraLight.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraLightItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ExtraLightItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Four.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Four.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-FourItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-FourItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Hair.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Hair.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-HairItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-HairItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Heavy.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Heavy.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-HeavyItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-HeavyItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Italic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Italic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Light.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Light.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-LightItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-LightItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Medium.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Medium.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-MediumItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-MediumItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Regular.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Regular.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-SemiBold.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-SemiBold.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-SemiBoldItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-SemiBoldItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Thin.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Thin.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ThinItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-ThinItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Two.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Two.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-TwoItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-TwoItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Ultra.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-Ultra.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-UltraItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-UltraItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-UltraLight.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-UltraLight.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-UltraLightItalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/fira/FiraSans-UltraLightItalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bold-subset.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bold-subset.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bold.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bold.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bolditalic-subset.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bolditalic-subset.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bolditalic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-bolditalic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-italic-subset.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-italic-subset.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-italic.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-italic.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-regular-subset.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-regular-subset.woff2 create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-regular.woff create mode 100755 mirzaev/notchat/system/public/themes/default/fonts/hack/hack-regular.woff2 create mode 100755 mirzaev/notchat/system/storage/servers/7ed5995b3d6b16779909ca68e2c4c8ddb05601cb26ef6c6c5c22bfa42a0763a8.json mode change 100644 => 100755 mirzaev/notchat/system/views/templater.php mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/chat.html mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/chats.html mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/core.html mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/footer.html mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/head.html mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/header.html mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/index.html mode change 100644 => 100755 mirzaev/notchat/system/views/themes/default/js.html create mode 100755 mirzaev/notchat/system/views/themes/default/sections/servers.html diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/mirzaev/notchat/system/controllers/core.php b/mirzaev/notchat/system/controllers/core.php old mode 100644 new mode 100755 diff --git a/mirzaev/notchat/system/controllers/index.php b/mirzaev/notchat/system/controllers/index.php old mode 100644 new mode 100755 index 6e96288..48930c0 --- a/mirzaev/notchat/system/controllers/index.php +++ b/mirzaev/notchat/system/controllers/index.php @@ -5,7 +5,8 @@ declare(strict_types=1); namespace mirzaev\notchat\controllers; // Files of the project -use mirzaev\notchat\controllers\core; +use mirzaev\notchat\controllers\core, + mirzaev\notchat\models\server; /** * Index controller @@ -29,4 +30,41 @@ final class index extends core // Exit (fail) return null; } + + /** + * Render the servers section + * + * @param array $parameters Parameters of the request (POST + GET) + * + * @return void Generated JSON to the output buffer + */ + public function servers(array $parameters = []): void + { + if ($_SERVER['REQUEST_METHOD'] === 'POST') { + // POST + + // Initializing a response headers + header('Content-Type: application/json'); + header('Content-Encoding: none'); + header('X-Accel-Buffering: no'); + + // Initializing of the output buffer + ob_start(); + + // Generating the reponse + echo json_encode( + [ + 'html' => $this->view->render('sections/servers.html', ['current' => server::read($parameters['server'], errors: $this->errors), 'servers' => server::all(100, errors: $this->errors) ?? []]), + 'errors' => null + ] + ); + + // Initializing a response headers + header('Content-Length: ' . ob_get_length()); + + // Sending and deinitializing of the output buffer + ob_end_flush(); + flush(); + } + } } diff --git a/mirzaev/notchat/system/controllers/server.php b/mirzaev/notchat/system/controllers/server.php new file mode 100755 index 0000000..21946a5 --- /dev/null +++ b/mirzaev/notchat/system/controllers/server.php @@ -0,0 +1,62 @@ + + */ +final class server extends core +{ + use errors; + + /** + * Write the server + * + * API for server registration + * + * @param array $parameters Parameters of the request (POST + GET) + * + * @return void Generated JSON to the output buffer + */ + public function write(array $parameters = []): void + { + if ($_SERVER['REQUEST_METHOD'] === 'POST') { + // POST + + // Create a file with server data + model::write($parameters['hash'], file_get_contents('php://input'), $this->errors); + + // Initializing a response headers + header('Content-Type: application/json'); + header('Content-Encoding: none'); + header('X-Accel-Buffering: no'); + + // Initializing of the output buffer + ob_start(); + + // Generating the reponse + echo json_encode( + [ + 'errors' => static::text($this->errors) + ] + ); + + // Initializing a response headers + header('Content-Length: ' . ob_get_length()); + + // Sending and deinitializing of the output buffer + ob_end_flush(); + flush(); + } + } +} diff --git a/mirzaev/notchat/system/controllers/traits/errors.php b/mirzaev/notchat/system/controllers/traits/errors.php new file mode 100755 index 0000000..68bb8db --- /dev/null +++ b/mirzaev/notchat/system/controllers/traits/errors.php @@ -0,0 +1,31 @@ + + */ +trait errors +{ + private static function text(array $errors): array + { + // Initializing of output buffer + $buffer = []; + + foreach ($errors as $offset => $error) { + // Iterating through errors + + // Checking for nesting and writing to the output buffer (entry into recursion) + if (isset($error['text'])) $buffer[] = $error['text']; + else if (is_array($error) && count($error) > 0) $buffer[$offset] = static::text($error); + } + + return $buffer; + } +} + diff --git a/mirzaev/notchat/system/models/core.php b/mirzaev/notchat/system/models/core.php old mode 100644 new mode 100755 index 86be6fb..4ee9b6e --- a/mirzaev/notchat/system/models/core.php +++ b/mirzaev/notchat/system/models/core.php @@ -23,6 +23,11 @@ class core extends model */ final public const POSTFIX = ''; + /** + * Path to storage + */ + final public const STORAGE = '..' . DIRECTORY_SEPARATOR . 'storage'; + /** * Constructor of an instance * @@ -33,7 +38,7 @@ class core extends model public function __construct(bool $initialize = true) { // For the extends system - parent::__construct($initialize); + parent::__construct($initialize); if ($initialize) { // Initializing is requested @@ -65,7 +70,7 @@ class core extends model public function __get(string $name): mixed { return match ($name) { - default => parent::__get($name) + default => parent::__get($name) }; } @@ -108,4 +113,3 @@ class core extends model }; } } - diff --git a/mirzaev/notchat/system/models/server.php b/mirzaev/notchat/system/models/server.php new file mode 100755 index 0000000..bd58ad0 --- /dev/null +++ b/mirzaev/notchat/system/models/server.php @@ -0,0 +1,113 @@ + + */ +class server extends core +{ + /** + * Path to storage of servers + */ + final public const SERVERS = core::STORAGE . DIRECTORY_SEPARATOR . 'servers'; + + /** + * Write + * + * Create the file with server settings + * + * @param string $hash Name of the file (unique hash) + * @param string $json Data of the server with JSON format + * @param array $errors Buffer of errors + * + * @return void + */ + public static function write(string $hash, string $json = '', array &$errors = []): void + { + try { + if (strlen($hash) > 512) throw new exception('Hash cannot be longer than 512 characters'); + + $file = fopen(static::SERVERS . DIRECTORY_SEPARATOR . "$hash.json", "w"); + fwrite($file, $json); + fclose($file); + } catch (exception $e) { + // Write to buffer of errors + $errors[] = [ + 'text' => $e->getMessage(), + 'file' => $e->getFile(), + 'line' => $e->getLine(), + 'stack' => $e->getTrace() + ]; + } + } + + /** + * Read all + * + * Read JSON from all files of servers + * + * @param int $amount Number of servers per page + * @param int $page Page of list of servers + * @param int $time Number of seconds since the file was last edited (86400 seconds is 1 day) + * @param array $errors Buffer of errors + * + * @return ?array Array with JSON entries, if found + */ + public static function all(int $amount = 100, int $page = 1, int $time = 86400, array &$errors = []): ?array + { + try { + // Initializing of the output buffer + $buffer = []; + + // Initializing the minimum value of amount + if ($amount < 1) $amount = 1; + + // Initializing the minimum value of page + if ($page < 1) $page = 1; + + // Initializing of amount to skip + $skip = $page * $amount; + + foreach (new parser(static::SERVERS) as $file) { + // Skipping unnecessary files + if (--$skip > $amount) continue; + + if ($file->isDot()) continue; + + if (time() - $file->getCTime() > $time && $file->isReadable()) { + $server = $file->openFile('r'); + $buffer[] = json_decode($server->fread($file->getSize())); + } + + if (--$amount < 1) break; + } + + // Exit (success) + return $buffer; + } catch (exception $e) { + // Write to buffer of errors + $errors[] = [ + 'text' => $e->getMessage(), + 'file' => $e->getFile(), + 'line' => $e->getLine(), + 'stack' => $e->getTrace() + ]; + } + + // Exit (fail) + return null; + } +} diff --git a/mirzaev/notchat/system/public/index.php b/mirzaev/notchat/system/public/index.php old mode 100644 new mode 100755 index 5532dcd..ee41870 --- a/mirzaev/notchat/system/public/index.php +++ b/mirzaev/notchat/system/public/index.php @@ -34,6 +34,8 @@ $router = new router; // Запись маршрутов $router->write('/', 'index', 'index'); +$router->write('/servers', 'index', 'servers', 'POST'); +$router->write('/servers/connect/$hash', 'server', 'write', 'POST'); // Инициализация ядра $core = new core(namespace: __NAMESPACE__, router: $router, controller: new controller(false), model: new model(false)); diff --git a/mirzaev/notchat/system/public/js/adapter.js b/mirzaev/notchat/system/public/js/adapter.js old mode 100644 new mode 100755 diff --git a/mirzaev/notchat/system/public/js/chats.js b/mirzaev/notchat/system/public/js/chats.js new file mode 100755 index 0000000..c380f58 --- /dev/null +++ b/mirzaev/notchat/system/public/js/chats.js @@ -0,0 +1,55 @@ +"use strict"; + +if (typeof window.chats !== "function") { + // Not initialized + + // Initialize of the class in global namespace + window.chats = class chats { + /** + * Request + * + * @param {string} address + * @param {string} body + * @param {string} method POST, GET... + * @param {object} headers + * @param {string} type Format of response (json, text...) + * + * @return {Promise} + */ + static generate = { + servers() { + core.request("/servers").then((json) => { + if (core.servers instanceof HTMLElement) core.servers.remove(); + if (json.errors !== null && typeof json.errors === 'object' && json.errors.length > 0) {} + else { + const element = document.createElement("div"); + core.header.after(element); + element.outerHTML = json.html; + + core.servers = document.body.querySelector("section[data-section='servers']"); + } + }); + }, + chat() { + core.request("/chat").then((json) => { + if (json.errors !== null && typeof json.errors === 'object' && json.errors.length > 0) {} + else { + const element = document.createElement("div"); + const position = core.main.children.length; + element.style.setProperty("--position", position); + core.main.append(element); + core.main.style.setProperty("--elements", position + 1); + element.innerHTML = json.html; + } + }); + }, + }; + }; +} + +// Dispatch event: "initialized" +document.dispatchEvent( + new CustomEvent("chats.initialized", { + detail: { chats: window.chats }, + }), +); diff --git a/mirzaev/notchat/system/public/js/core.js b/mirzaev/notchat/system/public/js/core.js new file mode 100755 index 0000000..58a591f --- /dev/null +++ b/mirzaev/notchat/system/public/js/core.js @@ -0,0 +1,57 @@ +"use strict"; + +if (typeof window.core !== "function") { + // Not initialized + + // Initialize of the class in global namespace + window.core = class core { + // Label for the
element + static main = document.body.getElementsByTagName('main')[0]; + + // Label for the
element + static header = document.body.getElementsByTagName('header')[0]; + + // Label for the