Formatting

pull/84/head
aandrew-me 3 years ago
parent 3fd50a3b6b
commit 97681adda5

@ -114,7 +114,7 @@ ipcMain.on("select-location", () => {
} }
}); });
ipcMain.on("select-config", ()=>{ ipcMain.on("select-config", () => {
const location = dialog.showOpenDialogSync(secondaryWindow, { const location = dialog.showOpenDialogSync(secondaryWindow, {
properties: ["openFile"], properties: ["openFile"],
}); });
@ -122,7 +122,7 @@ ipcMain.on("select-config", ()=>{
if (location) { if (location) {
secondaryWindow.webContents.send("configPath", location); secondaryWindow.webContents.send("configPath", location);
} }
}) });
app.on("window-all-closed", () => { app.on("window-all-closed", () => {
if (process.platform !== "darwin") { if (process.platform !== "darwin") {

@ -12,7 +12,7 @@ getId("menuIcon").addEventListener("click", (event) => {
let opacity = 1; let opacity = 1;
const fade = setInterval(() => { const fade = setInterval(() => {
if (count >= 10) { if (count >= 10) {
getId("menu").style.display = "none" getId("menu").style.display = "none";
clearInterval(fade); clearInterval(fade);
} else { } else {
opacity -= 0.1; opacity -= 0.1;
@ -71,7 +71,6 @@ function toggle() {
root.style.setProperty("--theme-toggle", "rgb(147, 174, 185)"); root.style.setProperty("--theme-toggle", "rgb(147, 174, 185)");
root.style.setProperty("--item-bg", "#dddddd"); root.style.setProperty("--item-bg", "#dddddd");
darkTheme = false; darkTheme = false;
localStorage.setItem("theme", "light"); localStorage.setItem("theme", "light");
} }
@ -101,18 +100,23 @@ function advancedToggle() {
// Check scroll go to top // Check scroll go to top
window.onscroll = function() {scrollFunction()}; window.onscroll = function () {
scrollFunction();
};
function scrollFunction() { function scrollFunction() {
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) { if (
getId("goToTop").style.display = "block"; document.body.scrollTop > 50 ||
} else { document.documentElement.scrollTop > 50
getId("goToTop").style.display = "none"; ) {
} getId("goToTop").style.display = "block";
} else {
getId("goToTop").style.display = "none";
}
} }
// Function to scroll go to top // Function to scroll go to top
getId("goToTop").addEventListener("click", () => { getId("goToTop").addEventListener("click", () => {
window.scrollTo({top: 0, behavior: 'smooth'}); window.scrollTo({ top: 0, behavior: "smooth" });
}); });

@ -1,14 +1,18 @@
function getId(id){ function getId(id) {
return document.getElementById(id) return document.getElementById(id);
} }
function querySelector(element){ function querySelector(element) {
return document.querySelector(element) return document.querySelector(element);
} }
const i18n = new(require('../translations/i18n')) const i18n = new (require("../translations/i18n"))();
// Translating texts // Translating texts
getId("back").textContent = i18n.__("Homepage") getId("back").textContent = i18n.__("Homepage");
getId("txt1").textContent = i18n.__("ytDownloader lets you download videos and audios from hundreds of sites like Youtube, Facebook, Instagram, Tiktok, Twitter and so on") getId("txt1").textContent = i18n.__(
getId("txt2").textContent = i18n.__("It's a Free and Open Source app built on top of Node.js and Electron. yt-dlp has been used for downloading") "ytDownloader lets you download videos and audios from hundreds of sites like Youtube, Facebook, Instagram, Tiktok, Twitter and so on"
getId("txt3").textContent = i18n.__("Source Code is available ") );
getId("sourceLink").textContent = i18n.__("here") getId("txt2").textContent = i18n.__(
"It's a Free and Open Source app built on top of Node.js and Electron. yt-dlp has been used for downloading"
);
getId("txt3").textContent = i18n.__("Source Code is available ");
getId("sourceLink").textContent = i18n.__("here");

@ -1,33 +1,39 @@
function getId(id){ function getId(id) {
return document.getElementById(id) return document.getElementById(id);
} }
function querySelector(element){ function querySelector(element) {
return document.querySelector(element) return document.querySelector(element);
} }
const i18n = new(require('../translations/i18n')) const i18n = new (require("../translations/i18n"))();
// Translating texts // Translating texts
getId("pasteUrl").textContent = i18n.__("Click to paste video link from clipboard [Ctrl + V]") getId("pasteUrl").textContent = i18n.__(
querySelector("#popup p").textContent = i18n.__("yt-dlp is being downloaded") "Click to paste video link from clipboard [Ctrl + V]"
getId("preferenceWin").textContent = i18n.__("Preferences") );
getId("aboutWin").textContent = i18n.__("About") querySelector("#popup p").textContent = i18n.__("yt-dlp is being downloaded");
getId("playlistWin").textContent = i18n.__("Download playlist") getId("preferenceWin").textContent = i18n.__("Preferences");
document.querySelectorAll(".formatSelect").forEach(element => { getId("aboutWin").textContent = i18n.__("About");
element.textContent = i18n.__("Select Format ") getId("playlistWin").textContent = i18n.__("Download playlist");
document.querySelectorAll(".formatSelect").forEach((element) => {
element.textContent = i18n.__("Select Format ");
}); });
getId("videoDownload").textContent = i18n.__("Download") getId("videoDownload").textContent = i18n.__("Download");
getId("audioDownload").textContent = i18n.__("Download") getId("audioDownload").textContent = i18n.__("Download");
getId("videoToggle").textContent = i18n.__("Video") getId("videoToggle").textContent = i18n.__("Video");
getId("audioToggle").textContent = i18n.__("Audio") getId("audioToggle").textContent = i18n.__("Audio");
getId("advancedVideoToggle").textContent = i18n.__("More options") getId("advancedVideoToggle").textContent = i18n.__("More options");
getId("advancedAudioToggle").textContent = i18n.__("More options") getId("advancedAudioToggle").textContent = i18n.__("More options");
getId("rangeText").textContent= i18n.__("Download particular time-range") getId("rangeText").textContent = i18n.__("Download particular time-range");
getId("startTime").title = i18n.__("If kept empty, it will start from the beginning") getId("startTime").title = i18n.__(
getId("endTime").title = i18n.__("If kept empty, it will be downloaded to the end") "If kept empty, it will start from the beginning"
getId("processing").textContent = i18n.__("Processing") );
getId("start").textContent = i18n.__("Start") getId("endTime").title = i18n.__(
getId("end").textContent = i18n.__("End") "If kept empty, it will be downloaded to the end"
getId("subHeader").textContent = i18n.__("Subtitles") );
getId("subTxt").textContent =i18n.__("Download subtitles if available") getId("processing").textContent = i18n.__("Processing");
getId("extractHeader").textContent =i18n.__("Extract Audio") getId("start").textContent = i18n.__("Start");
getId("extractBtn").textContent =i18n.__("Extract") getId("end").textContent = i18n.__("End");
getId("subHeader").textContent = i18n.__("Subtitles");
getId("subTxt").textContent = i18n.__("Download subtitles if available");
getId("extractHeader").textContent = i18n.__("Extract Audio");
getId("extractBtn").textContent = i18n.__("Extract");

Loading…
Cancel
Save