Skip to content

Commit

Permalink
feat: added a option on setting page to view changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
bajrangCoder committed Nov 10, 2024
1 parent fa249cb commit 41f3926
Show file tree
Hide file tree
Showing 34 changed files with 142 additions and 30 deletions.
3 changes: 2 additions & 1 deletion src/lang/ar-ye.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/be-by.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/bn-bd.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/cs-cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/de-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "URI kopieren",
"delete entries": "Sind sie sicher, das Sie {count} Einträge löschen wollen?",
"deleting items": "Löschen von {count} Einträgen...",
"import project zip": "Projekt(-Zip) importieren"
"import project zip": "Projekt(-Zip) importieren",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/es-sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/fr-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/hi-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/hu-hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Uri másolása",
"delete entries": "Biztosan töröl {count} elemet?",
"deleting items": "{count} elem törlése…",
"import project zip": "Project(zip) importálása"
"import project zip": "Project(zip) importálása",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/id-id.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,5 +389,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/ir-fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/it-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/ja-jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/ko-kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/ml-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/mm-unicode.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/mm-zawgyi.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/pl-pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/pu-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/ru-ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/tl-ph.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/tr-tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/uk-ua.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/uz-uz.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/vi-vn.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,5 +388,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/zh-hant.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
3 changes: 2 additions & 1 deletion src/lang/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,5 +387,6 @@
"copy uri": "Copy Uri",
"delete entries": "Are you sure you want to delete {count} items?",
"deleting items": "Deleting {count} items...",
"import project zip": "Import Project(zip)"
"import project zip": "Import Project(zip)",
"changelog": "Change Log"
}
42 changes: 42 additions & 0 deletions src/pages/changelog/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import "./style.scss";
import Page from "components/page";
import actionStack from "lib/actionStack";
import markdownIt from "markdown-it";
import markdownItTaskLists from "markdown-it-task-lists";
import helpers from "utils/helpers";

export default async function Changelog() {
const CHANGELOG_URL =
"https://raw.githubusercontent.com/deadlyjack/Acode/main/CHANGELOG.md";
const $page = Page(strings["changelog"]);
const $content = <div className="md" id="changelog"></div>;

$content.innerHTML = '<div class="loading">Loading changelog...</div>';

$page.content = $content;
app.append($page);

try {
const changeLog = await fetch(CHANGELOG_URL);
const changeLogText = await changeLog.text();

const cleanedText = changeLogText.replace(/^#\s*Change\s*Log\s*\n*/i, "");

const htmlContent = markdownIt({ html: true })
.use(markdownItTaskLists)
.render(cleanedText);

$content.innerHTML = htmlContent;
} catch (error) {
$content.innerHTML = '<div class="error">Failed to load changelog</div>';
}

$page.onhide = function () {
actionStack.remove("changelog");
};

actionStack.push({
id: "changelog",
action: $page.hide,
});
}
8 changes: 8 additions & 0 deletions src/pages/changelog/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function plugin({ id, installed }, onInstall, onUninstall) {
import(/* webpackChunkName: "changelog" */ "./changelog").then((res) => {
const Changelog = res.default;
Changelog();
});
}

export default plugin;
22 changes: 22 additions & 0 deletions src/pages/changelog/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#changelog {
height: 100%;
width: 100%;
padding: 8px;
overflow: auto;
}

.loading {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
color: var(--primary-text-color);
font-size: 1.2em;
animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
0% { opacity: 0.6; }
50% { opacity: 1; }
100% { opacity: 0.6; }
}
10 changes: 10 additions & 0 deletions src/settings/mainSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import openFile from "lib/openFile";
import removeAds from "lib/removeAds";
import appSettings from "lib/settings";
import settings from "lib/settings";
import Changelog from "pages/changelog/changelog";
import Donate from "pages/donate";
import plugins from "pages/plugins";
import themeSetting from "pages/themeSetting";
Expand Down Expand Up @@ -91,6 +92,11 @@ export default function mainSettings() {
text: `${strings["edit"]} settings.json`,
icon: "edit",
},
{
key: "changeLog",
text: `${strings["changelog"]}`,
icon: "update",
},
];

if (IS_FREE_VERSION) {
Expand Down Expand Up @@ -165,6 +171,10 @@ export default function mainSettings() {
}
break;

case "changeLog":
Changelog();
break;

default:
break;
}
Expand Down

0 comments on commit 41f3926

Please sign in to comment.