Part of the JavaScript selectors clean-up effort.
#1574470: Selectors clean-up
#1415788: Javascript winter clean-up
| Comment | File | Size | Author |
|---|---|---|---|
| #31 | interdiff.txt | 912 bytes | pguillard |
| #31 | selectors_clean_up-1751434-31.patch | 12.18 KB | pguillard |
| #29 | selectors_clean_up-1751434-29.patch | 12.52 KB | lauriii |
| #27 | selectors_clean_up-1751434-27.patch | 13.53 KB | lauriii |
| #27 | interdiff.txt | 7.46 KB | lauriii |
Comments
Comment #1
nod_performance sensitive script, see if it can be made better.
Comment #2
oxyc commentedHere's an initial cleanup patch
Comment #3
oxyc commentedComment #4
oxyc commentedHad a typo on keyup.
Comment #5
oxyc commentedThis could probably be further simplified into:
----
This is probably the most intensive operation but I dont really see a way to optimize it.
Comment #6
oxyc commentedI changed the .each into a simple .after()
Comment #7
nod_user.js:
Can you make the
passwordCheck,passwordCheckMatchfunctions into named functions?I'd rather have that as:
user.permissions.js:
can you separate the .once() call and the function in there? there is no need for this closure. Have a look at other core scripts to see what I mean (yay! can finally say that with some confidence :).
Beside that it's all good :) thanks a lot!
Comment #8
oxyc commentedNice, thanks.
This also saved us from a global pollution, didn't think about passwordCheckMatch() populating
thiswith a variable and then being called as a global function. Jshint didn't catch it as a function expression either, quite odd.A good reason for these new conventions :)
So my solution is just to remove both possible classes before adding a new one, without checking if it exists or not. If you prefer using a closure to memorize, I'll revise it.
Comment #9
oxyc commentedComment #10
nod_tag
Comment #11
droplet commentedGive a better name ? eg $passwordInputParent.
no space "function()"
add event namespaces ? should it bind "change" event ? and "input" event for IME
can we call it $usernameInput
Comment #12
droplet commentedI will update it when #1684880: JSHint user get commited
Comment #13
droplet commentedToo many changes, won't attach an interdiff.
Comment #15
droplet commented#13: user.d8.patch queued for re-testing.
Comment #16
droplet commentedComment #17
nod_Stray semi-colon in user.persmissions.js
the
$dummychange looks good, you're right, no need to clone it.The selector can even be transformed to be
works the same for me.
Changes to user.js looks good :)
Comment #18
droplet commentedI found it in user.js
2. the selectors transform I leave as it, no diff.
Comment #19
droplet commentedNothing is perfect, Move On!.
Comment #21
droplet commentedTry again, it applied locally
Comment #22
manuel garcia commentedComment #23
pguillard commentedRe-rolled!
Comment #24
nod_Seeing a few ESLint errors:
Comment #25
pguillard commentedI applied #24 corrections.
No clue for the indicatorClass warning
Comment #26
lauriiiComment #27
lauriiiComment #28
nod_Need reroll :/
Looks good though.
Comment #29
lauriiiComment #30
nod_indicatorColoris not used, why do we need that one, is anything else using it?eslint error on the user.permission.js file.
Comment #31
pguillard commentedI have problems with eslint, but here's what I suggest..
Comment #32
nod_Looks good to me, eslint is happy.
Password is working as expected. Permission page too.
Comment #34
alexpottI've reviewed this and manually tested - all looks okay. Not the easiest issue to review as the changes seem to be from multiple scopes - internal clean ups and new js specific classes. Ideally this would be done in separate issues.
Given that we are preceding with other issues that add the
js-I'm going to commit this patch as part of that effort. However, in future it would be great if the scope of the these patches could be reduced to just doing the necessary to do that. Committed 74363f6 and pushed to 8.0.x. Thanks!