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

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

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