mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 18:21:47 +00:00
Formatting
This commit is contained in:
12
index.js
12
index.js
@ -5,8 +5,8 @@ const electron = require("electron");
|
||||
const is = require("electron-is");
|
||||
const { autoUpdater } = require("electron-updater");
|
||||
|
||||
const { setApplicationMenu } = require("./menu");
|
||||
const { getEnabledPlugins, store } = require("./store");
|
||||
const { setApplicationMenu } = require("./menu");
|
||||
const { fileExists, injectCSS } = require("./plugins/utils");
|
||||
|
||||
const app = electron.app;
|
||||
@ -45,10 +45,10 @@ function createMainWindow() {
|
||||
nodeIntegration: false,
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
nativeWindowOpen: true, // window.open return Window object(like in regular browsers), not BrowserWindowProxy
|
||||
affinity : "main-window" // main window, and addition windows should work in one process
|
||||
affinity: "main-window", // main window, and addition windows should work in one process
|
||||
},
|
||||
frame: !is.macOS(),
|
||||
titleBarStyle: is.macOS() ? "hiddenInset": "default"
|
||||
titleBarStyle: is.macOS() ? "hiddenInset" : "default",
|
||||
});
|
||||
if (windowMaximized) {
|
||||
win.maximize();
|
||||
@ -65,7 +65,7 @@ function createMainWindow() {
|
||||
}
|
||||
});
|
||||
|
||||
getEnabledPlugins().forEach(plugin => {
|
||||
getEnabledPlugins().forEach((plugin) => {
|
||||
console.log("Loaded plugin - " + plugin);
|
||||
const pluginPath = path.join(__dirname, "plugins", plugin, "back.js");
|
||||
fileExists(pluginPath, () => {
|
||||
@ -151,7 +151,7 @@ app.on("ready", () => {
|
||||
title: "Application Update",
|
||||
message: "A new version is available",
|
||||
detail:
|
||||
"A new version is available and can be downloaded at https://github.com/th-ch/youtube-music/releases/latest"
|
||||
"A new version is available and can be downloaded at https://github.com/th-ch/youtube-music/releases/latest",
|
||||
};
|
||||
electron.dialog.showMessageBox(dialogOpts);
|
||||
});
|
||||
@ -163,7 +163,7 @@ app.on("ready", () => {
|
||||
app.on("before-quit", () => {
|
||||
forceQuit = true;
|
||||
});
|
||||
mainWindow.on("close", event => {
|
||||
mainWindow.on("close", (event) => {
|
||||
if (!forceQuit) {
|
||||
event.preventDefault();
|
||||
mainWindow.hide();
|
||||
|
||||
8
menu.js
8
menu.js
@ -1,7 +1,7 @@
|
||||
const { app, Menu } = require("electron");
|
||||
|
||||
const { getAllPlugins } = require("./plugins/utils");
|
||||
const { isPluginEnabled, enablePlugin, disablePlugin } = require("./store");
|
||||
const { getAllPlugins } = require("./plugins/utils");
|
||||
|
||||
module.exports.setApplicationMenu = () => {
|
||||
const menuTemplate = [
|
||||
@ -38,7 +38,7 @@ module.exports.setApplicationMenu = () => {
|
||||
{
|
||||
label: "Select All",
|
||||
accelerator: "CmdOrCtrl+A",
|
||||
selector : "selectAll:"
|
||||
selector: "selectAll:",
|
||||
},
|
||||
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
|
||||
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
|
||||
@ -46,8 +46,8 @@ module.exports.setApplicationMenu = () => {
|
||||
{ type: "separator" },
|
||||
{ role: "minimize" },
|
||||
{ role: "close" },
|
||||
{ role: "quit" }
|
||||
]
|
||||
{ role: "quit" },
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ const store = new Store({
|
||||
height: 550
|
||||
},
|
||||
url: "https://music.youtube.com",
|
||||
plugins: ["navigation", "shortcuts", "adblocker"]
|
||||
plugins: ["navigation", "shortcuts", "adblocker"],
|
||||
}
|
||||
});
|
||||
|
||||
@ -17,5 +17,5 @@ module.exports = {
|
||||
isPluginEnabled: plugin => plugins.isEnabled(store, plugin),
|
||||
getEnabledPlugins: () => plugins.getEnabledPlugins(store),
|
||||
enablePlugin: plugin => plugins.enablePlugin(store, plugin),
|
||||
disablePlugin : plugin => plugins.disablePlugin(store, plugin)
|
||||
disablePlugin: plugin => plugins.disablePlugin(store, plugin),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user