From 4c46bceb7d09738f6f6d4c72bbac966a35f0c0b2 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 12 Apr 2020 19:00:05 +0200 Subject: [PATCH] Formatting --- index.js | 44 ++++++++++++++++++++++---------------------- menu.js | 12 ++++++------ store/index.js | 14 +++++++------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/index.js b/index.js index fe18f419..489e27a4 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,13 @@ "use strict"; const path = require("path"); -const electron = require("electron"); -const is = require("electron-is"); +const electron = require("electron"); +const is = require("electron-is"); const { autoUpdater } = require("electron-updater"); -const { setApplicationMenu } = require("./menu"); const { getEnabledPlugins, store } = require("./store"); -const { fileExists, injectCSS } = require("./plugins/utils"); +const { setApplicationMenu } = require("./menu"); +const { fileExists, injectCSS } = require("./plugins/utils"); const app = electron.app; @@ -32,23 +32,23 @@ function onClosed() { } function createMainWindow() { - const windowSize = store.get("window-size"); + const windowSize = store.get("window-size"); const windowMaximized = store.get("window-maximized"); const win = new electron.BrowserWindow({ - icon : icon, - width : windowSize.width, - height : windowSize.height, + icon: icon, + width: windowSize.width, + height: windowSize.height, backgroundColor: "#000", - show : false, - webPreferences : { - 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 + show: false, + webPreferences: { + 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 }, - frame : !is.macOS(), - titleBarStyle: is.macOS() ? "hiddenInset": "default" + frame: !is.macOS(), + 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, () => { @@ -146,12 +146,12 @@ app.on("ready", () => { autoUpdater.checkForUpdatesAndNotify(); autoUpdater.on("update-available", () => { const dialogOpts = { - type : "info", + type: "info", buttons: ["OK"], - title : "Application Update", + 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" + detail: + "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(); diff --git a/menu.js b/menu.js index 6a864d33..56bd1623 100644 --- a/menu.js +++ b/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 = [ @@ -27,7 +27,7 @@ module.exports.setApplicationMenu = () => { if (process.platform === "darwin") { const name = app.getName(); menuTemplate.unshift({ - label : name, + label: name, submenu: [ { role: "about" }, { type: "separator" }, @@ -36,9 +36,9 @@ module.exports.setApplicationMenu = () => { { role: "unhide" }, { type: "separator" }, { - label : "Select All", + 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" }, + ], }); } diff --git a/store/index.js b/store/index.js index 8d34c783..82cefaab 100644 --- a/store/index.js +++ b/store/index.js @@ -4,18 +4,18 @@ const plugins = require("./plugins"); const store = new Store({ defaults: { "window-size": { - width : 1100, + width: 1100, height: 550 }, - url : "https://music.youtube.com", - plugins: ["navigation", "shortcuts", "adblocker"] + url: "https://music.youtube.com", + plugins: ["navigation", "shortcuts", "adblocker"], } }); module.exports = { - store : store, - isPluginEnabled : plugin => plugins.isEnabled(store, plugin), + store: store, + isPluginEnabled: plugin => plugins.isEnabled(store, plugin), getEnabledPlugins: () => plugins.getEnabledPlugins(store), - enablePlugin : plugin => plugins.enablePlugin(store, plugin), - disablePlugin : plugin => plugins.disablePlugin(store, plugin) + enablePlugin: plugin => plugins.enablePlugin(store, plugin), + disablePlugin: plugin => plugins.disablePlugin(store, plugin), };