- );
-}
-
-export default App;
diff --git a/src/components/button.jsx b/src/components/button.jsx
deleted file mode 100644
index 43922b6..0000000
--- a/src/components/button.jsx
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { Link } from "react-router-dom";
-
-function Button({
- href,
- className,
- onClick,
- w,
- children,
- color = "bg-zinc-100 hover:bg-zinc-300 dark:bg-zinc-600 dark:hover:bg-zinc-800",
-}) {
- return (
-
-
- );
-}
-
-function ButtonWithIcon(props) {
- return (
-
- );
-}
-
-export { Button, IconWithText, ButtonWithIcon };
diff --git a/src/components/checkbox.jsx b/src/components/checkbox.jsx
deleted file mode 100644
index 1d7ad0b..0000000
--- a/src/components/checkbox.jsx
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-function CheckBox(props) {
- return (
-
-
-
-
- );
-}
-
-export { CheckBox };
diff --git a/src/components/copytocb.jsx b/src/components/copytocb.jsx
deleted file mode 100644
index 6294517..0000000
--- a/src/components/copytocb.jsx
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { useState } from "react";
-import { ClipboardIcon, CheckIcon } from "@heroicons/react/24/outline";
-import { useEffect } from "react";
-
-function CopyToClipboard(props) {
- let [copied, setCopied] = useState(false);
-
- useEffect(() => {
- if (copied === true) {
- setTimeout(() => {
- setCopied(false);
- }, 1000);
- }
- });
-
- return (
-
- );
-}
-
-export { CopyToClipboard, CodeCopyBtn };
diff --git a/src/components/markdown.jsx b/src/components/markdown.jsx
deleted file mode 100644
index c0adc59..0000000
--- a/src/components/markdown.jsx
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import rehypeMathjax from "rehype-mathjax";
-import remarkMath from "remark-math";
-import ReactMarkdown from "react-markdown";
-import remarkGfm from "remark-gfm";
-
-import SyntaxHighlighter from "react-syntax-highlighter";
-import { darcula, github } from "react-syntax-highlighter/dist/esm/styles/hljs";
-
-import { CodeCopyBtn } from "./copytocb";
-
-let theme = window.matchMedia("(prefers-color-scheme: dark)").matches
- ? "dark"
- : "light";
-
-function CodeBlock(props) {
- let text = props.children[0];
- let oneline = text.indexOf("\n") <= 1;
- if (oneline) {
- return {text};
- } else
- return (
-
- {text}
-
- );
-}
-
-function RenderMarkdown(props) {
- return (
-
- {props.children}
-
- );
-}
-
-function Pre({ children }) {
- let text = children[0].props.children[0];
- let oneline = text.indexOf("\n") <= 1;
- return (
-
- {!oneline && }
- {children}
-
- );
-}
-
-export default RenderMarkdown;
diff --git a/src/components/menu.jsx b/src/components/menu.jsx
deleted file mode 100644
index 96883ad..0000000
--- a/src/components/menu.jsx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { ButtonWithIcon } from "./button";
-import {
- MagnifyingGlassCircleIcon,
- PencilIcon,
- ExclamationCircleIcon,
- Cog6ToothIcon,
- ChevronDownIcon,
-} from "@heroicons/react/24/outline";
-import { useState } from "react";
-
-function Menu() {
- const [hidden, setHidden] = useState(window.innerWidth < 1024 ? true : false);
-
- return (
-
- );
-}
-
-export default Menu;
diff --git a/src/components/note.jsx b/src/components/note.jsx
deleted file mode 100644
index c0f47e1..0000000
--- a/src/components/note.jsx
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import RenderMarkdown from "../components/markdown";
-import { timestamp2text } from "./utils";
-
-function Note({ note }) {
- return (
- <>
-
- >
- );
-}
-
-export default Note;
diff --git a/src/components/openai.js b/src/components/openai.js
deleted file mode 100644
index 4366455..0000000
--- a/src/components/openai.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { Configuration, OpenAIApi } from "openai";
-
-async function Complete(text) {
- document.body.style.cursor = "wait";
-
- let initText = text;
-
- const configuration = new Configuration({
- apiKey: settings.openAiKey,
- });
- const openai = new OpenAIApi(configuration);
- const response = await openai.createCompletion({
- model: "text-davinci-003",
- prompt: initText,
- max_tokens: 1000,
- temperature: 1,
- top_p: 1,
- n: 1,
- stream: false,
- logprobs: null,
- });
-
- document.body.style.cursor = "default";
-
- return initText + response.data.choices[0].text;
-}
-
-export { Complete };
diff --git a/src/components/settingsInputs.jsx b/src/components/settingsInputs.jsx
deleted file mode 100644
index 931384f..0000000
--- a/src/components/settingsInputs.jsx
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-/* eslint-disable react-refresh/only-export-components */
-import { CheckBox } from "./checkbox";
-import { inputStyle, settingsAddInput } from "./styles";
-import { ButtonWithIcon } from "./button";
-import { Complete } from "../components/openai";
-import { DocumentTextIcon } from "@heroicons/react/24/outline";
-
-function SettingsCheckBox({ label, title, className, settingName, onClick }) {
- return (
- {
- !!settingName && setSetting(settingName, e.target.checked);
- !!onClick && onClick(e);
- }}
- />
- );
-}
-
-function SettingsTextInput({
- placeholder,
- title,
- label,
- className,
- settingName,
- onChange,
- secret,
-}) {
- return (
-
- )}
- >
- );
-}
-
-export {
- SettingsCheckBox,
- SettingsTextInput,
- SettingsSelectInput,
- SettingsSection,
- setSetting,
- NoteNameInput,
- NoteTextArea,
- NotesAdditionalSettings,
-};
diff --git a/src/components/socket.js b/src/components/socket.js
deleted file mode 100644
index 84edadc..0000000
--- a/src/components/socket.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { io } from "socket.io-client";
-import { reRenderPage } from "./utils";
-
-const socket = io();
-
-function onConnect() {
- console.log("Socket connected");
-}
-
-function onDisconnect() {
- console.log("Socket disconnected, local mode only");
- window.alreadyConnected = false;
-}
-
-function onFooEvent() {
- console.log("bar");
-}
-
-function onSync({ settings, Notes, NoteText, NoteName }) {
- localStorage.setItem("Notes", Notes);
- localStorage.setItem("NoteText", NoteText);
- localStorage.setItem("NoteName", NoteName);
- localStorage.setItem("settings", settings);
- reRenderPage();
-}
-
-socket.on("connect", onConnect);
-socket.on("disconnect", onDisconnect);
-socket.on("foo", onFooEvent);
-socket.on("broadcastSync", onSync);
-
-export default socket;
diff --git a/src/components/styles.js b/src/components/styles.js
deleted file mode 100644
index 4e494e4..0000000
--- a/src/components/styles.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-let inputStyle =
- "block px-3 py-1.5 text-base font-normal text-gray-700 dark:text-white bg-white dark:bg-zinc-900 bg-clip-padding border border-solid border-gray-300 rounded-lg transition ease-in-out focus:border-blue-600 focus:outline-none";
-let settingsAddInput = "w-full lg:w-1/4";
-
-export { inputStyle, settingsAddInput };
diff --git a/src/components/utils.js b/src/components/utils.js
deleted file mode 100644
index 42c715c..0000000
--- a/src/components/utils.js
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { Locales } from "../localisation/main";
-
-function timestamp2text(time) {
- time = new Date(time);
- return time.toLocaleString(settings.language);
-}
-
-function reRenderPage() {
- window.dispatchEvent(new Event("reRenderPage"));
-}
-
-function localesProcess(reRender) {
- let locale =
- window.settings.language ||
- navigator.language ||
- navigator.userLanguage ||
- "en-US";
-
- let lang = locale.split("-")[0];
-
- let localeObj = Object.assign({}, Locales.en);
- Object.assign(localeObj, Locales[lang]);
- Object.assign(localeObj, Locales[locale]);
-
- window.locals = localeObj;
-
- if (reRender) reRenderPage();
-}
-
-async function getNetLocale(lang, fileName) {
- return (await (await fetch(`localisation/${lang}/${fileName}`)).text()) || "";
-}
-
-function nameUpdate(val) {
- socket.emit("nameChanged", {
- name: val,
- room: settings.CollabEditPassword,
- });
- window.lastSocketUpdate = Date.now();
-}
-
-function textUpdate(val) {
- socket.emit("textChanged", {
- text: val,
- room: settings.CollabEditPassword,
- });
- window.lastSocketUpdate = Date.now();
-}
-
-function collab_edit_init(setName, setText, saveToLocalStorage = true) {
- if (settings.CollabEdit === true) {
- if (!window.alreadyConnected) {
- socket.emit("joinRoom", settings.CollabEditPassword);
- window.alreadyConnected = true;
- window.lastSocketUpdate = Date.now();
- window.socketTimeout = 100;
- window.nameChanged = false;
- window.textChanged = false;
-
- setInterval(() => {
- if (window.nameChanged) {
- nameUpdate(window.nameChanged);
- window.nameChanged = false;
- }
-
- if (window.textChanged) {
- textUpdate(window.textChanged);
- window.textChanged = false;
- }
- }, window.socketTimeout);
- }
-
- socket.on("textChanged", (data) => {
- setText(data.text);
- if (saveToLocalStorage) localStorage.setItem("NoteText", data.text);
- document.getElementById("noteTextArea").value = data.text;
- });
-
- socket.on("nameChanged", (data) => {
- setName(data.name);
- if (saveToLocalStorage) localStorage.setItem("NoteName", data.name);
- document.getElementById("noteNameInput").value = data.name;
- });
-
- socket.on("roomJoined", () => {
- nameUpdate(localStorage.getItem("NoteName"), true);
- textUpdate(localStorage.getItem("NoteText"), true);
- });
- }
-}
-
-export {
- timestamp2text,
- reRenderPage,
- localesProcess,
- getNetLocale,
- collab_edit_init,
- nameUpdate,
- textUpdate,
-};
diff --git a/src/index.css b/src/index.css
deleted file mode 100644
index 373d3f8..0000000
--- a/src/index.css
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-@tailwind base;
-@tailwind components;
-@tailwind utilities;
-
-@layer base {
- /* styles for displaying markdown */
- .md h1 {
- @apply text-6xl;
- }
- .md h2 {
- @apply text-5xl;
- }
- .md h3 {
- @apply text-4xl;
- }
- .md h4 {
- @apply text-3xl;
- }
- .md h5 {
- @apply text-2xl;
- }
- .md h6 {
- @apply text-xl;
- }
-
- .md blockquote {
- @apply border-l-4 pl-2 rounded-lg ml-4 mt-2 mb-2;
- @apply bg-zinc-200 border-zinc-400;
- @apply dark:bg-zinc-800 dark:border-zinc-600;
- @apply pb-2;
- }
-
- .md hr {
- @apply mb-4 mt-4 border-2 rounded-lg;
- }
-
- .md ul {
- @apply list-disc list-inside ml-4;
- }
-
- .md li ul {
- @apply list-disc list-inside;
- }
-
- .md ol {
- @apply list-decimal list-inside ml-4;
- }
-
- .md li ol {
- @apply list-decimal list-inside ml-4;
- }
-
- .md-code {
- @apply p-1;
- @apply rounded-lg;
- @apply bg-zinc-200 border-zinc-400;
- @apply dark:bg-zinc-800 dark:border-zinc-600 overflow-auto;
- }
-
- .md a {
- @apply inline-block bg-transparent text-blue-600;
- }
-
- .md table {
- @apply w-full lg:w-1/2;
- border-style: hidden;
- }
-
- .md table thead {
- @apply bg-zinc-200 dark:bg-zinc-800;
- }
-
- .md table tr {
- @apply border-2 border-zinc-400;
- }
-
- .md img {
- @apply w-96 ease-[cubic-bezier(.69,.58,.32,1.69)] hover:scale-105 rounded-2xl hover:drop-shadow-2xl transition duration-500 lg:ml-5;
- }
-
- .md .math-inline {
- display: inline-block;
- }
- .md li p {
- display: inline;
- }
-
- /* other styles */
-
- .blog-pre {
- @apply mt-2 mb-2 relative;
- }
-
- .code-copy-btn {
- @apply text-zinc-400 dark:text-zinc-300 absolute right-2 top-2 cursor-pointer;
- }
-
- .code-copy-btn:hover {
- @apply text-zinc-500 dark:text-zinc-400;
- }
-}
diff --git a/src/localisation/en.js b/src/localisation/en.js
deleted file mode 100644
index 7fc8923..0000000
--- a/src/localisation/en.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { getNetLocale } from "../components/utils";
-
-let en = {
- about_md: await getNetLocale("en", "about.md"),
- Notes: "Notes",
- Write: "Write",
- Chat: "Chat",
- Settings: "Settings",
- About: "About",
- Name: "Name",
- UserName: "Username",
- User: "User",
- PhotoUrl: "Photo URL",
- Url: "URL",
- Status: "Status",
- UserStatus: "User status",
- EditPreview: "Editing in preview",
- EditPreviewWarn:
- "Can cause irreversible text changes, such as breaking code tags",
- PublicNote: "Public note",
- PublicNoteTitle: "If enabled, note will be visible to all users",
- Interface: "Interface",
- Language: "Language",
- ThirdPartyApi: "Third party API",
- OpenAiKey: "OpenAI API key",
- Key: "Key",
- Preview: "Preview",
- NotePlaceholder:
- "Your note starts here. You can use markdown, MathJax and GFM.",
- NoteName: "Note name",
- Publish: "Publish",
- Save: "Save",
- WriteNote: "Write note",
- PubError: "Error in publishing note",
- PubErrorMsg: "Note was not published due to an unknown error",
- PubErrorMsgNoName: "Note was not published, because it does not have a name.",
- PubErrorMsgNoText: "Note was not published, because it does not have a text.",
- Back: "Back",
- PubNoteNotExist: "This note does not exist",
- NoteNotExist: "This note does not exist",
- Idontexists: "I don't exist",
- PubUrlPlaceholder:
- "The link to send a public note. When you click this link, the note will disappear from the server and be saved locally.",
- Delete: "Delete",
- Open: "Open",
- NoNotesYet: "No notes yet",
- AIComplete: "Continue Note (AI)",
- AdditionalFeatures: "Additional features",
- CollabEdit: "Collaborative editing",
- Password: "Password",
- SyncPassword: "Sync password",
- CollabEditPassword: "Password for collaborative editing",
- BroadcastSync: "Getting notes, settings from another device",
- SyncAll: "Send data to all devices",
- Sync: "Sync",
- Search: "Search",
- NoNotesFound: "No notes found",
- LocalNote: "Local",
- Menu: "Menu",
- SourceCode: "Source code",
- Edit: "Edit",
-};
-
-export default en;
diff --git a/src/localisation/eo.js b/src/localisation/eo.js
deleted file mode 100644
index 16a61c0..0000000
--- a/src/localisation/eo.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-//translated with Google Translate
-//if you want to help with translations, please contribute to this project
-
-let eo = {
- Notes: "Notoj",
- Write: "Skribu",
- Chat: "Babilejo",
- Settings: "Agordoj",
- About: "Pri",
- Name: "Nomo",
- UserName: "Uzantnomo",
- User: "Uzanto",
- PhotoUrl: "Foto URL",
- Url: "url",
- Status: "Statuso",
- UserStatus: "Uzanto -Statuso",
- EditPreview: "Redaktado en Antaŭrigardo",
- EditPreviewWarn:
- "Povas kaŭzi neinversigeblajn tekstajn ŝanĝojn, kiel rompi kodajn etikedojn",
- PublicNote: "Publika Noto",
- PublicNoteTitle: "Se ebligita, noto estos videbla por ĉiuj uzantoj",
- Interface: "Interfaco",
- Language: "Lingvo",
- ThirdPartyApi: "Tria API",
- OpenAiKey: "OpenAI API ŝlosilo",
- Key: "Ŝlosilo",
- Preview: "Antaŭrigardo",
- NotePlaceholder:
- "Via noto komenciĝas ĉi tie.Vi povas uzi Markdown, Mathjax kaj GFM.",
- NoteName: "Note nomo",
- Publish: "Publikigi",
- Save: "Savi",
- WriteNote: "Skribu Noton",
- PubError: "Eraro en Eldona Noto",
- PubErrorMsg: "Noto ne estis publikigita pro nekonata eraro",
- PubErrorMsgNoName: "Noto ne estis publikigita, ĉar ĝi ne havas nomon.",
- PubErrorMsgNoText: "Noto ne estis publikigita, ĉar ĝi ne havas tekston.",
- Back: "Reen",
- PubNoteNotExist: "Ĉi tiu noto ne ekzistas",
- NoteNotExist: "Ĉi tiu noto ne ekzistas",
- Idontexists: "Mi ne ekzistas",
- PubUrlPlaceholder:
- "La ligo por sendi publikan noton.Kiam vi alklakas ĉi tiun ligon, la noto malaperos de la servilo kaj estos konservita surloke.",
- Delete: "Forigi",
- Open: "Malferma",
- NoNotesYet: "Ankoraŭ neniuj notoj",
- AIComplete: "Daŭrigu Noton (AI)",
- AdditionalFeatures: "Pliaj Trajtoj",
- CollabEdit: "Kunlabora Redaktado",
- Password: "Pasvorto",
- SyncPassword: "Sinkrona pasvorto",
- CollabEditPassword: "Pasvorto por kunlabora redaktado",
- BroadcastSync: "Ricevante notojn, agordojn de alia aparato",
- SyncAll: "Sendado de datumoj",
- Sync: "Sinkronigi",
- Search: "Serĉo",
- NoNotesFound: "Neniuj notoj trovitaj",
- LocalNote: "Loka",
- PublishNote: "Publika",
- Menu: "Menuo",
-};
-
-export default eo;
diff --git a/src/localisation/es.js b/src/localisation/es.js
deleted file mode 100644
index 30009ea..0000000
--- a/src/localisation/es.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-//translated with Google Translate
-//if you want to help with translations, please contribute to this project
-
-let es = {
- Notes: "Notas",
- Write: "Escribir",
- Chat: "Charlar",
- Settings: "Ajustes",
- About: "Acerca de",
- Name: "Nombre",
- UserName: "Nombre de usuario",
- User: "Usuaria",
- PhotoUrl: "URL fotográfica",
- Url: "Url",
- Status: "Estado",
- UserStatus: "Estatus de usuario",
- EditPreview: "Edición en vista previa",
- EditPreviewWarn:
- "Puede causar cambios de texto irreversibles, como etiquetas de código de ruptura",
- PublicNote: "Nota pública",
- PublicNoteTitle:
- "Si está habilitado, Note será visible para todos los usuarios",
- Interface: "Interfaz",
- Language: "Idioma",
- ThirdPartyApi: "API de terceros",
- OpenAiKey: "Clave de API de OpenAI",
- Key: "Llave",
- Preview: "Avance",
- NotePlaceholder: "Tu nota comienza aquí.Puede usar Markdown, MathJax y GFM.",
- NoteName: "Nombre de nota",
- Publish: "Publicar",
- Save: "Ahorrar",
- WriteNote: "Toma nota",
- PubError: "Error en la nota de publicación",
- PubErrorMsg: "La nota no se publicó debido a un error desconocido",
- PubErrorMsgNoName: "No se publicó una nota, porque no tiene un nombre.",
- PubErrorMsgNoText: "La nota no se publicó, porque no tiene un texto.",
- Back: "Atrás",
- PubNoteNotExist: "Esta nota no existe",
- NoteNotExist: "Esta nota no existe",
- Idontexists: "No existe",
- PubUrlPlaceholder:
- "El enlace para enviar una nota pública.Cuando haga clic en este enlace, la nota desaparecerá del servidor y se guardará localmente.",
- Delete: "Borrar",
- Open: "Abierto",
- NoNotesYet: "No hay notas todavía",
- AIComplete: "Continuar nota (ai)",
- AdditionalFeatures: "Características adicionales",
- CollabEdit: "Edición colaborativa",
- Password: "Contraseña",
- SyncPassword: "Sincronización de contraseña",
- CollabEditPassword: "Contraseña para edición colaborativa",
- BroadcastSync: "Obtener notas, configuraciones de otro dispositivo",
- SyncAll: "Envío de datos",
- Sync: "Sincronización",
- Search: "Buscar",
- NoNotesFound: "No se encontraron notas",
- LocalNote: "Local",
- PublishNote: "Pública",
- Menu: "Menú",
-};
-
-export default es;
diff --git a/src/localisation/ja.js b/src/localisation/ja.js
deleted file mode 100644
index 3758b31..0000000
--- a/src/localisation/ja.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-//translated with Google Translate
-//if you want to help with translations, please contribute to this project
-
-let ja = {
- Notes: "ノート",
- Write: "書く",
- Chat: "チャット",
- Settings: "設定",
- About: "だいたい",
- Name: "名前",
- UserName: "ユーザー名",
- User: "ユーザー",
- PhotoUrl: "写真の URL",
- Url: "URL",
- Status: "スターテス",
- UserStatus: "ユーザーステータス",
- EditPreview: "プレビューでの編集",
- EditPreviewWarn:
- "コードタグの破損など、元に戻せないテキスト変更を引き起こす可能性があります",
- PublicNote: "公開メモ",
- PublicNoteTitle: "有効にすると、メモはすべてのユーザーに表示されます",
- Interface: "インターフェース",
- Language: "言語",
- ThirdPartyApi: "サードパーティ API",
- OpenAiKey: "OpenAI API キー",
- Key: "鍵",
- Preview: "プレビュー",
- NotePlaceholder:
- "あなたのメモはここから始まります。マークダウン、MathJax、GFM を使用できます。",
- NoteName: "音名",
- Publish: "公開",
- Save: "保存",
- WriteNote: "記帳",
- PubError: "メモの公開エラー",
- PubErrorMsg: "不明なエラーのため、ノートは公開されませんでした",
- PubErrorMsgNoName: "名前がないため、ノートは公開されませんでした。",
- PubErrorMsgNoText: "テキストがないため、ノートは公開されませんでした。",
- Back: "戻る",
- PubNoteNotExist: "このメモは存在しません",
- NoteNotExist: "このメモは存在しません",
- Idontexists: "私は存在しません",
- PubUrlPlaceholder:
- "公開メモを送信するためのリンク。このリンクをクリックすると、メモはサーバーから消え、ローカルに保存されます。",
- Delete: "消去",
- Open: "開ける",
- NoNotesYet: "メモはまだありません",
- AIComplete: "継続評価 (AI)",
- AdditionalFeatures: "追加機能",
- CollabEdit: "共同編集",
- Password: "パスワード",
- SyncPassword: "パスワードを同期",
- CollabEditPassword: "共同編集用パスワード",
- BroadcastSync: "別のデバイスからメモ、設定を取得する",
- SyncAll: "すべてのデバイスにデータを送信",
- Sync: "同期",
- Search: "検索",
- NoNotesFound: "メモが見つかりません",
- LocalNote: "地元",
- PublishNote: "公共",
- Menu: "メニュー",
-};
-
-export default ja;
diff --git a/src/localisation/main.js b/src/localisation/main.js
deleted file mode 100644
index f4827d2..0000000
--- a/src/localisation/main.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import ru from "./ru";
-import en from "./en";
-import es from "./es";
-import eo from "./eo";
-import ja from "./ja";
-import zh from "./zh";
-
-let Locales = {
- ru,
- en,
- es,
- eo,
- ja,
- zh,
-};
-
-let langChoices = [
- {
- value: "ru-RU",
- label: "Русский",
- },
- {
- value: "en-US",
- label: "English (US)",
- },
- {
- value: "es",
- label: "Español",
- },
- {
- value: "eo",
- label: "Esperanto",
- },
- {
- value: "ja-JP",
- label: "日本語",
- },
- {
- value: "zh-CN",
- label: "中国人",
- },
-];
-
-export { Locales, langChoices };
diff --git a/src/localisation/ru.js b/src/localisation/ru.js
deleted file mode 100644
index 9ddbc77..0000000
--- a/src/localisation/ru.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { getNetLocale } from "../components/utils";
-
-let ru = {
- about_md: await getNetLocale("ru", "about.md"),
- Notes: "Заметки",
- Write: "Написать",
- Chat: "Чат",
- Settings: "Настройки",
- About: "Подробнее",
- Name: "Имя",
- UserName: "Имя пользователя",
- User: "Пользователь",
- PhotoUrl: "Ссылка на фото",
- Url: "Ссылка",
- Status: "Статус",
- UserStatus: "Статус пользователя",
- EditPreview: "Редактирование в предпросмотре",
- EditPreviewWarn:
- "Может вызывать необратимые изменения текста, например ломает теги кода",
- PublicNote: "Публичная заметка",
- PublicNoteTitle: "Если включено, то заметка будет видна всем пользователям",
- Interface: "Интерфейс",
- Language: "Язык",
- ThirdPartyApi: "Сторонний API",
- OpenAiKey: "OpenAI API ключ",
- Key: "Ключ",
- Preview: "Предпросмотр",
- NotePlaceholder:
- "Ваша заметка начинается здесь. Вы можете использовать markdown, MathJax и GFM.",
- NoteName: "Название заметки",
- Publish: "Опубликовать",
- Save: "Сохранить",
- WriteNote: "Написать заметку",
- PubError: "Ошибка в публикации заметки",
- PubErrorMsg: "Заметка не была опубликована из-за неизвестной ошибки",
- PubErrorMsgNoName:
- "Заметка не была опубликована, так как отсутствует название.",
- PubErrorMsgNoText: "Заметка не была опубликована, так как отсутствует текст.",
- Back: "Назад",
- PubNoteNotExist: "Такой публичной заметки не существует",
- NoteNotExist: "Заметки не существует",
- Idontexists: "Меня не существует",
- PubUrlPlaceholder:
- "Ссылка для отправки публичной заметки. При переходе на эту ссылку, заметка исчезнет с сервера и будет сохранена локально.",
- Delete: "Удалить",
- Open: "Открыть",
- NoNotesYet: "Заметок пока нет",
- AIComplete: "Продолжить заметку (ИИ)",
- AdditionalFeatures: "Дополнительные функции",
- CollabEdit: "Совместное редактирование",
- Password: "Пароль",
- CollabEditPassword: "Пароль для совместного редактирования",
- SyncPassword: "Пароль для синхронизации",
- BroadcastSync: "Получение заметок, настроек с другого устройства",
- SyncAll: "Отправить данные",
- Sync: "Синхронизация",
- Search: "Поиск",
- NoNotesFound: "Заметок не найдено",
- LocalNote: "Локальная",
- PublishNote: "Публичная",
- Menu: "Меню",
- SourceCode: "Исходный код",
- Edit: "Изменить",
-};
-
-export default ru;
diff --git a/src/localisation/zh.js b/src/localisation/zh.js
deleted file mode 100644
index 78c7265..0000000
--- a/src/localisation/zh.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-//translated with Google Translate
-//if you want to help with translations, please contribute to this project
-
-let zh = {
- Notes: "笔记",
- Write: "写",
- Chat: "聊天",
- Settings: "设置",
- About: "关于",
- Name: "姓名",
- UserName: "用户名",
- User: "用户",
- PhotoUrl: "照片网址",
- Url: "网址",
- Status: "地位",
- UserStatus: "用户状态",
- EditPreview: "在预览中编辑",
- EditPreviewWarn: "可能导致不可逆转的文本更改,例如破坏代码标签",
- PublicNote: "公众号",
- PublicNoteTitle: "如果启用,注释将对所有用户可见",
- Interface: "界面",
- Language: "语言",
- ThirdPartyApi: "第三方接口",
- OpenAiKey: "OpenAI API 密钥",
- Key: "钥匙",
- Preview: "预览",
- NotePlaceholder: "你的笔记从这里开始。你可以使用 markdown、MathJax 和 GFM。",
- NoteName: "笔记名称",
- Publish: "发布",
- Save: "节省",
- WriteNote: "写笔记",
- PubError: "发布笔记时出错",
- PubErrorMsg: "由于未知错误,笔记未发布",
- PubErrorMsgNoName: "注释未发布,因为它没有名称。",
- PubErrorMsgNoText: "注释未发布,因为它没有文本。",
- Back: "后退",
- PubNoteNotExist: "此备注不存在",
- NoteNotExist: "此备注不存在",
- Idontexists: "我不存在",
- PubUrlPlaceholder:
- "发送公共笔记的链接。当您单击此链接时,该笔记将从服务器上消失并保存在本地。",
- Delete: "删除",
- Open: "打开",
- NoNotesYet: "还没有笔记",
- AIComplete: "继续评级 (AI)",
- AdditionalFeatures: "附加功能",
- CollabEdit: "协同编辑",
- Password: "密码",
- SyncPassword: "同步密码",
- CollabEditPassword: "协同编辑密码",
- BroadcastSync: "从另一台设备获取笔记、设置",
- SyncAll: "向所有设备发送数据",
- Sync: "同步",
- Search: "搜索",
- NoNotesFound: "找不到笔记",
- LocalNote: "当地的",
- PublishNote: "民众",
- Menu: "菜单",
-};
-
-export default zh;
diff --git a/src/main.jsx b/src/main.jsx
deleted file mode 100644
index dad614e..0000000
--- a/src/main.jsx
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import React from "react";
-import ReactDOM from "react-dom/client";
-import App from "./App";
-import "./index.css";
-import { BrowserRouter } from "react-router-dom";
-
-ReactDOM.createRoot(document.getElementById("root")).render(
-
-
-
-
-
-);
diff --git a/src/pages/create.jsx b/src/pages/create.jsx
deleted file mode 100644
index 0fb1b97..0000000
--- a/src/pages/create.jsx
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { ButtonWithIcon } from "../components/button";
-import { ChevronDoubleRightIcon } from "@heroicons/react/24/outline";
-import { CheckBox } from "../components/checkbox";
-import { useState } from "react";
-import RenderMarkdown from "../components/markdown";
-import {
- collab_edit_init,
- timestamp2text,
- textUpdate,
-} from "../components/utils";
-import rehypeRemark from "rehype-remark/lib";
-import ContentEditable from "react-contenteditable";
-import ReactDOMServer from "react-dom/server";
-import { unified } from "unified";
-import rehypeParse from "rehype-parse";
-import remarkStringify from "remark-stringify";
-import remarkGfm from "remark-gfm";
-import remarkMath from "remark-math";
-import {
- NoteNameInput,
- NoteTextArea,
- NotesAdditionalSettings,
- SettingsCheckBox,
-} from "../components/settingsInputs";
-
-function CreateNote() {
- const [preview, setPreview] = useState(false);
- const [publicState, setPublicState] = useState(settings.publicNote);
- const [text, setText] = useState(localStorage.getItem("NoteText"));
- const [name, setName] = useState(localStorage.getItem("NoteName"));
-
- async function previewChange(val) {
- let md = await unified()
- .use(remarkGfm)
- .use(remarkMath)
- .use(rehypeParse)
- .use(rehypeRemark)
- .use(remarkStringify)
- .process(val.target.value);
-
- md = md.value.trim();
-
- localStorage.setItem("NoteText", md);
-
- if (settings.CollabEdit === true) {
- socket.emit("textChanged", {
- text: md,
- room: settings.CollabEditPassword,
- });
- }
- }
-
- collab_edit_init(setName, setText, false);
-
- return (
-
- );
-}
-
-export default CreateNote;
diff --git a/src/pages/note.jsx b/src/pages/note.jsx
deleted file mode 100644
index f6df7fe..0000000
--- a/src/pages/note.jsx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { useParams } from "react-router-dom";
-import {
- ArchiveBoxArrowDownIcon,
- ChevronDoubleLeftIcon,
- ChevronDoubleRightIcon,
- PencilIcon,
- TrashIcon,
-} from "@heroicons/react/24/outline";
-import { ButtonWithIcon } from "../components/button";
-import Note from "../components/note";
-import { useState } from "react";
-import {
- NoteNameInput,
- NoteTextArea,
- NotesAdditionalSettings,
-} from "../components/settingsInputs";
-import { collab_edit_init, nameUpdate, textUpdate } from "../components/utils";
-
-function NotePage() {
- let params = useParams();
-
- let notes = localStorage.getObj("Notes");
- let note = notes[params.id];
-
- let [edit, setEdit] = useState(false);
- let [text, setText] = useState(note.text);
- let [name, setName] = useState(note.name);
-
- collab_edit_init(setName, setText, false);
-
- return (
-
- );
-}
-
-export default NotePage;
diff --git a/src/pages/notes.jsx b/src/pages/notes.jsx
deleted file mode 100644
index acb2a9a..0000000
--- a/src/pages/notes.jsx
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { ButtonWithIcon } from "../components/button";
-import { ChevronDoubleRightIcon } from "@heroicons/react/24/outline";
-import { timestamp2text } from "../components/utils";
-import Fuse from "fuse.js";
-import { inputStyle } from "../components/styles";
-import { useState } from "react";
-import { setSetting } from "../components/settingsInputs";
-import RemoveMarkdown from "remove-markdown";
-
-function Notes() {
- if (!settings.newNotes) {
- let notesObj = localStorage.getObj("Notes");
- let notes = Object.entries(notesObj);
- for (let [id, note] of notes) {
- note.id = id;
- note.textTime = timestamp2text(note.time);
- notesObj[id] = note;
- }
- localStorage.setObj("Notes", notesObj);
- setSetting("newNotes", true);
- }
-
- let n = Object.values(localStorage.getObj("Notes"));
-
- const [search, setSearch] = useState("");
- const [indexed, setIndexed] = useState(false);
-
- if (search && !indexed) {
- window.fuseIndex = new Fuse(n, {
- includeScore: true,
- useExtendedSearch: true,
- keys: [
- "name",
- "textTime",
- {
- name: "text",
- getFn: (obj) => RemoveMarkdown(obj.text),
- },
- ],
- });
- setIndexed(true);
- }
-
- let found = search === "" ? n : window.fuseIndex.search(search);
-
- if (search !== "") {
- found = found
- .sort((a, b) => {
- return a.score - b.score;
- })
- .map(({ item }) => item);
- } else {
- found = found.sort((a, b) => {
- return b.time - a.time;
- });
- }
-
- let notes = found.map((item) => {
- return (
-
- );
-}
-
-export default Notes;
diff --git a/src/pages/pubError.jsx b/src/pages/pubError.jsx
deleted file mode 100644
index 2359959..0000000
--- a/src/pages/pubError.jsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { timestamp2text } from "../components/utils";
-import { ChevronDoubleLeftIcon } from "@heroicons/react/24/outline";
-import { ButtonWithIcon } from "../components/button";
-import { useSearchParams } from "react-router-dom";
-
-function PubError() {
- const [searchParams] = useSearchParams();
- let err = searchParams.get("err");
-
- return (
-
-
-
-
-
-
- {locals.PubError}
-
-
- {timestamp2text(Date.now())}
-
-
-
{err ? err : locals.PubErrorMsg}
-
-
- );
-}
-
-export default PubError;
diff --git a/src/pages/pubNote.jsx b/src/pages/pubNote.jsx
deleted file mode 100644
index a1e2a97..0000000
--- a/src/pages/pubNote.jsx
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import RenderMarkdown from "../components/markdown";
-import { useState } from "react";
-import { Navigate, useParams } from "react-router-dom";
-import { timestamp2text } from "../components/utils";
-import { ChevronDoubleLeftIcon } from "@heroicons/react/24/outline";
-import { ButtonWithIcon } from "../components/button";
-
-function PubNote() {
- let params = useParams();
-
- let [note, setNote] = useState(false);
-
- if (note === false)
- fetch(`/get-note/del/${params.id}`)
- .then((data) => {
- data
- .json()
- .then((data) => {
- setNote(data);
- })
- .catch(() => {
- setNote({
- text: "Такой публичной заметки не сущуествует",
- name: "Меня не существует",
- time: Date.now(),
- save: false,
- });
- });
- })
- .catch(() => {
- setNote({
- text: "Такой публичной заметки не сущуествует",
- name: "Меня не существует",
- time: Date.now(),
- save: false,
- });
- });
- else {
- if (note.save !== false) {
- localStorage.setItem("NotePubTime", note.time);
- localStorage.setItem("NoteName", note.name);
- localStorage.setItem("NoteText", note.text);
- return ;
- } else {
- return (
-
-
-
-
-
- {note.name || "Загрузка..."}
-
-
- {timestamp2text(note.time || Date.now())}
-
-
-
- {note.text || "Загрузка..."}
-
-
-
- );
- }
- }
-}
-
-export default PubNote;
diff --git a/src/pages/pubNoteSafe.jsx b/src/pages/pubNoteSafe.jsx
deleted file mode 100644
index a954237..0000000
--- a/src/pages/pubNoteSafe.jsx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { useState } from "react";
-import { useParams } from "react-router-dom";
-import { ChevronDoubleLeftIcon } from "@heroicons/react/24/outline";
-import { ButtonWithIcon } from "../components/button";
-import { CopyToClipboard } from "../components/copytocb";
-import Note from "../components/note";
-
-function PubNoteSafe() {
- let params = useParams();
-
- let [note, setNote] = useState(false);
- let nullNote = {
- text: locals.PubNoteNotExist,
- name: locals.Idontexists,
- time: Date.now(),
- code: 0,
- };
-
- if (note === false)
- fetch(`/get-note/safe/${params.id}`)
- .then((data) => {
- data
- .json()
- .then((data) => {
- data.code = 1;
- setNote(data);
- })
- .catch(() => {
- setNote(nullNote);
- });
- })
- .catch(() => {
- setNote(nullNote);
- });
-
- return (
-
-
-
- {note?.code === 1 && (
-
-
-
- {locals.PubUrlPlaceholder}
-
-
-
-
- )}
-
-
-
- );
-}
-
-export default PubNoteSafe;
diff --git a/src/pages/publish.jsx b/src/pages/publish.jsx
deleted file mode 100644
index c496a61..0000000
--- a/src/pages/publish.jsx
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { useEffect } from "react";
-import { useNavigate } from "react-router-dom";
-import { useSearchParams } from "react-router-dom";
-
-function Publish() {
- const navigate = useNavigate();
- const [searchParams] = useSearchParams();
-
- useEffect(() => {
- let err = false;
-
- let note;
-
- if (searchParams.get("local_id")) {
- let localNote =
- localStorage.getObj("Notes")[searchParams.get("local_id")];
- note = {
- name: localNote.name,
- text: localNote.text,
- };
- } else {
- note = {
- name: localStorage.getItem("NoteName"),
- text: localStorage.getItem("NoteText"),
- };
- }
-
- if (!note.name) {
- err = locals.PubErrorMsgNoName;
- }
- if (!note.text) {
- err = locals.PubErrorMsgNoText;
- }
-
- fetch(`/publish`, {
- method: "POST",
- headers: {
- "Content-Type": "application/json;charset=utf-8",
- },
- body: JSON.stringify(note),
- })
- .then((data) => {
- data
- .json()
- .then((data) => {
- localStorage.removeItem("NoteName");
- localStorage.removeItem("NoteText");
- navigate(`/pubNotesSafe/${data.id}`, { replace: true });
- })
- .catch(() => {
- if (err == false) {
- navigate(`/pubError`, { replace: true });
- } else navigate(`/pubError?err=${err}`, { replace: true });
- });
- })
- .catch(() => {
- navigate(`/pubError`, { replace: true });
- });
- });
-
- return ;
-}
-
-export default Publish;
diff --git a/src/pages/save-local.jsx b/src/pages/save-local.jsx
deleted file mode 100644
index ad7bfd5..0000000
--- a/src/pages/save-local.jsx
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import { Navigate } from "react-router-dom";
-import { timestamp2text } from "../components/utils";
-
-function Save() {
- let name = localStorage.getItem("NoteName");
- let text = localStorage.getItem("NoteText");
- let pubTime = Number(localStorage.getItem("NotePubTime"));
-
- if (!name || !text) return ;
-
- let notesObj = localStorage.getObj("Notes");
-
- let time = Date.now();
-
- notesObj[time] = {
- id: time,
- name,
- text,
- time,
- textTime: timestamp2text(time),
- pubTime,
- pub: !!pubTime,
- };
-
- localStorage.setObj("Notes", notesObj);
-
- localStorage.removeItem("NoteName");
- localStorage.removeItem("NoteText");
- localStorage.removeItem("NotePubTime");
-
- return ;
-}
-
-export default Save;
diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx
deleted file mode 100644
index 77cc0eb..0000000
--- a/src/pages/settings.jsx
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- Copyright (c) 2023 artegoser (Artemy Egorov)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
- */
-
-import {
- SettingsCheckBox,
- SettingsTextInput,
- SettingsSelectInput,
- SettingsSection,
- setSetting,
-} from "../components/settingsInputs";
-import { ButtonWithIcon } from "../components/button";
-import { ChevronDoubleRightIcon } from "@heroicons/react/24/outline";
-import { localesProcess, reRenderPage } from "../components/utils";
-import { langChoices } from "../localisation/main";
-
-function Settings() {
- let lastName = settings.userName;
-
- return (
-