mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2026-01-28 05:10:50 +03:00
Added basic time editing.
The button presses don't work yet as YouTube steals the events.
This commit is contained in:
12
src/utils.ts
12
src/utils.ts
@@ -256,6 +256,14 @@ class Utils {
|
||||
xmlhttp.send();
|
||||
}
|
||||
|
||||
getFormattedMinutes(seconds: number) {
|
||||
return Math.floor(seconds / 60);
|
||||
}
|
||||
|
||||
getFormattedSeconds(seconds: number) {
|
||||
return seconds % 60;
|
||||
}
|
||||
|
||||
getFormattedTime(seconds: number, precise?: boolean) {
|
||||
let minutes = Math.floor(seconds / 60);
|
||||
let secondsNum: number = seconds - minutes * 60;
|
||||
@@ -275,6 +283,10 @@ class Utils {
|
||||
return formatted;
|
||||
}
|
||||
|
||||
getRawSeconds(minutes: number, seconds: number): number {
|
||||
return minutes * 60 + seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this Firefox (web-extensions)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user