-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JS refactoring part 2: helper functions, poyfills #3084
Conversation
@SamantazFox please, deploy this PR on test.invidious.io 😸 |
@AHOHNMYC it's deployed! Seems like a few things don't work, like player hotkeys. Maybe the trace below can help?
|
…etails-summary in IE11
@SamantazFox after second applying
All this issues were fixed. Please, reapply this commit third time 😺 Optional |
@AHOHNMYC Done, I've deployed your latest commit :) |
@SamantazFox thanks! I've tested almost everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it looks very good to me! I've made some small remarks, in addition to unifox's comment.
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
partial rewrite notifications.js innerText to textContent fixed bug with clamping
extra spaces removed
Added six strings fixes #3089 |
@AHOHNMYC can you please put the (Put it right before invidious/src/invidious/views/template.ecr Lines 16 to 21 in f2f3f04
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor whitespace errors ^^
Thanks a lot for your contribution to invidious! The JS rewrite is giving a ton of fresh air to the project ^^ |
Added script
_helpers.js
which includes portion of polyfills for IE11, clamping function and handy wrappers for:To improve code readability and complexity:
4
isMediaError.MEDIA_ERR_SRC_NOT_SUPPORTED
)Added polyfills usage where it is possible to reduce code and improve readability
Removed redundant
window
anddocument
usage.window
is global object and some properties likelocation
are doubled indocument
Repeated pieces of code are moved to global variables in the beginning of files
Constructions like
function (x) {otherFunction(x)}
replaced with justotherFunction(x)
Removed useless try-catches (but added one useful)
Rewritten themes management
Added support for per-frame navigation with
,
and.
keys #2113. But "honest per-frame" will work only for 29.97 FPS videosFixes #2412 using
preventDefault()
All new code checked to work with IE11