apply fix from eslint

This commit is contained in:
JellyBrick
2023-08-29 19:14:51 +09:00
parent c722896a73
commit 897cfd3c7d
33 changed files with 471 additions and 524 deletions

View File

@ -1,15 +1,15 @@
const { injectCSS } = require('../utils');
const path = require('node:path');
const { globalShortcut } = require('electron');
const { injectCSS } = require('../utils');
/*
This is used to determine if plugin is actually active
(not if its only enabled in options)
*/
let enabled = false;
const { globalShortcut } = require('electron');
module.exports = (win, options) => {
enabled = true;
injectCSS(win.webContents, path.join(__dirname, 'volume-hud.css'));

View File

@ -26,7 +26,7 @@ const writeOptions = debounce(() => {
setOptions('precise-volume', options);
}, 1000);
module.exports.moveVolumeHud = debounce((showVideo) => {
const moveVolumeHud = debounce((showVideo) => {
const volumeHud = $('#volumeHud');
if (!volumeHud) {
return;
@ -36,6 +36,7 @@ module.exports.moveVolumeHud = debounce((showVideo) => {
? `${($('ytmusic-player').clientHeight - $('video').clientHeight) / 2}px`
: 0;
}, 250);
module.exports.moveVolumeHud = moveVolumeHud;
const hideVolumeHud = debounce((volumeHud) => {
volumeHud.style.opacity = 0;
@ -215,7 +216,7 @@ const tooltipTargets = [
];
function setTooltip(volume) {
for (target of tooltipTargets) {
for (const target of tooltipTargets) {
$(target).title = `${volume}%`;
}
}

View File

@ -6,7 +6,7 @@ const { setMenuOptions } = require('../../config/plugins');
const promptOptions = require('../../providers/prompt-options');
function changeOptions(changedOptions, options, win) {
for (option in changedOptions) {
for (const option in changedOptions) {
options[option] = changedOptions[option];
}