Whitespace

This commit is contained in:
Tamius Han 2021-10-25 23:11:34 +02:00
parent 746a78577e
commit a4948d3eef
5 changed files with 146 additions and 134 deletions

View File

@ -22,6 +22,13 @@ interface ActionScopeInterface {
}[], }[],
} }
interface RestrictionsSettings {
disableOnSmallPlayers?: boolean; // Whether ultrawidify should disable itself when the player is small
minAllowedWidth?: number; // if player is less than this many px wide, ultrawidify will disable itself
minAllowedHeight?: number; // if player is less than this many px tall, ultrawidify will disable itself
onlyAllowInFullscreen?: boolean; // if enabled, ultrawidify will be disabled when not in full screen regardless of what previous two options say
}
interface SettingsInterface { interface SettingsInterface {
arDetect: { arDetect: {
disabledReason: string, // if automatic aspect ratio has been disabled, show reason disabledReason: string, // if automatic aspect ratio has been disabled, show reason
@ -150,11 +157,15 @@ interface SettingsInterface {
testRowOffset: number // we test this % of height from detected edge testRowOffset: number // we test this % of height from detected edge
} }
}, },
restrictions?: RestrictionsSettings;
zoom: { zoom: {
minLogZoom: number, minLogZoom: number,
maxLogZoom: number, maxLogZoom: number,
announceDebounce: number // we wait this long before announcing new zoom announceDebounce: number // we wait this long before announcing new zoom
}, },
miscSettings: { miscSettings: {
mousePan: { mousePan: {
enabled: boolean enabled: boolean
@ -286,6 +297,8 @@ interface SettingsInterface {
}, },
css?: string; css?: string;
usePlayerArInFullscreen?: boolean; usePlayerArInFullscreen?: boolean;
restrictions?: RestrictionsSettings;
} }
} }
} }

View File

@ -361,7 +361,6 @@ class PlayerData {
element = element.parentNode; element = element.parentNode;
} }
if (element) { if (element) {
this.updatePlayerDimensions(element);
return element; return element;
} }
} else if (this.settings.active.sites[host]?.DOM?.player?.querySelectors) { } else if (this.settings.active.sites[host]?.DOM?.player?.querySelectors) {

View File

@ -361,7 +361,7 @@ class VideoData {
if (this.pageInfo.defaultCrop) { if (this.pageInfo.defaultCrop) {
this.resizer.setAr(this.pageInfo.defaultCrop); this.resizer.setAr(this.pageInfo.defaultCrop);
} else { } else {
this.resizer.reset(); this.resizer.reset();
try { try {
this.stopArDetection(); this.stopArDetection();
@ -537,7 +537,7 @@ class VideoData {
} }
/** /**
* Some sites try to accomodate ultrawide users by "cropping" videos * Some sites try to accommodate ultrawide users by "cropping" videos
* by setting 'style' attribute of the video element to 'height: X%', * by setting 'style' attribute of the video element to 'height: X%',
* where 'X' is something greater than 100. * where 'X' is something greater than 100.
* *