Skip to content

Commit

Permalink
remove ESLint errors #2
Browse files Browse the repository at this point in the history
  • Loading branch information
4yman-0 committed Nov 2, 2024
1 parent b84a0ec commit 64169a8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
6 changes: 3 additions & 3 deletions js&css/extension/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ extension.storage.get = function (key) {
return this.data[key];
} else {
var target = this.data;
/*path = key.split('/').filter(function (value) {
return value != '';
});*/
/*path = key.split('/').filter(function (value) {
return value != '';
});*/

for (var i = 0, l = key.length; i < l; i++) {
var part = key[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
html[it-header-transparent=true] ytd-masthead#masthead {background: transparent !important;}
html[it-header-transparent=true] #background.ytd-masthead {background-color: rgba(230, 230, 230, 0.1) !important;}
html[it-header-transparent=true] ytd-masthead[frosted-glass] #background.ytd-masthead {backdrop-filter: blur(1px) !important;}
html[it-header-transparent=true] { --ytd-searchbox-background: rgba(var(--ytd-searchbox-background), 0.5) !important;}
html[it-header-transparent=true] { --ytd-searchbox-background: rgba(var(--ytd-searchbox-background), 0.5) !important;}

/* Header-transparent alternative by @joaolscosta */
/* Change opacity when scrolling down */
Expand Down
13 changes: 6 additions & 7 deletions js&css/extension/www.youtube.com/general/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ extension.features.popupWindowButtons = function (event) {
else { width = innerWidth * 0.4; height = innerHeight * 0.4; }
if (!ytPlayer) {
let shorts = /short/.test(this.parentElement.href);
if ( width / height < 1 ) { let vertical = true } else { let vertical = false }
let vertical = false;
if ( width / height < 1 ) { vertical = true }
if ( !vertical && shorts ) { width = height * 0.6}
if ( vertical && !shorts ) { height = width * 0.6}
}
Expand Down Expand Up @@ -289,10 +290,12 @@ extension.features.popupWindowButtons = function (event) {

extension.features.font = function (changed) {
var option = extension.storage.get('font');
var link = this.font.link,
style = this.font.style;

if (option && option !== 'Default') {
var link = this.font.link || document.createElement('link'),
style = this.font.style || document.createElement('style');
link = link || document.createElement('link'),
style = style || document.createElement('style');

link.rel = 'stylesheet';
link.href = '//fonts.googleapis.com/css2?family=' + option;
Expand All @@ -305,13 +308,9 @@ extension.features.font = function (changed) {
this.font.link = link;
this.font.style = style;
} else if (changed) {
var link = this.font.link,
style = this.font.style;

if (link) {
link.remove();
}

if (style) {
style.remove();
}
Expand Down
8 changes: 4 additions & 4 deletions js&css/web-accessible/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ ImprovedTube.ytElementsHandler = function (node) {
} else if (id === 'movie_player') {
if (!this.elements.player) {
ImprovedTube.elements.player = node;
// if (this.storage.player_autoplay === false) { ImprovedTube.elements.player.stopVideo(); }
// if (this.storage.player_autoplay === false) { ImprovedTube.elements.player.stopVideo(); }
ImprovedTube.elements.video = node.querySelector('video');
ImprovedTube.elements.player_left_controls = node.querySelector('.ytp-left-controls');
ImprovedTube.elements.player_right_controls = node.querySelector('.ytp-right-controls');
Expand Down Expand Up @@ -234,7 +234,7 @@ ImprovedTube.ytElementsHandler = function (node) {
ImprovedTube.expandDescription(node); console.log("EXPAND DESCRIPTION, OLD WAY")
}, 750);
}} */
} else if (id === 'panels') {
} else if (id === 'panels') {

Check warning on line 237 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Trailing spaces not allowed
ImprovedTube.elements.panels = node;
}
};
Expand Down Expand Up @@ -405,8 +405,8 @@ ImprovedTube.playerOnPause = function (event) {
};

if (document.documentElement.dataset.pageType === 'video'
&& (ImprovedTube.storage.description === "expanded" || ImprovedTube.storage.transcript || ImprovedTube.storage.chapters )) {
ImprovedTube.forbidFocus = function (ms) {
&& (ImprovedTube.storage.description === "expanded" || ImprovedTube.storage.transcript || ImprovedTube.storage.chapters )) {

Check warning on line 408 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Trailing spaces not allowed
ImprovedTube.forbidFocus = function (ms) {

Check warning on line 409 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Trailing spaces not allowed
const originalFocus = HTMLElement.prototype.focus; // Backing up default method - other methods: Element.prototype.scrollIntoView window.scrollTo window.scrollBy
// Override YouTube's scroll method:
HTMLElement.prototype.focus = function() {console.log("Preventing YouTube's scripted scrolling, when expanding the video description for you"); }

Check warning on line 412 in js&css/web-accessible/functions.js

View workflow job for this annotation

GitHub Actions / lint-and-test

Missing space before function parentheses
Expand Down
2 changes: 1 addition & 1 deletion menu/satus.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ satus.locale.get = function (string) {
# IMPORT // old: satus.locale.import(url, onload, onsuccess);
--------------------------------------------------------------*/
satus.locale.import = function (code, callback, path) {
// if (!path) { path = '_locales/'; }
// if (!path) { path = '_locales/'; }
function importLocale (locale, successCallback) {
var url = chrome.runtime.getURL(path + locale + '/messages.json');
fetch(url)
Expand Down

0 comments on commit 64169a8

Please sign in to comment.