-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Introduce jquery formvalidator for com_languages #5046
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
Closed
Closed
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8d3f308
formvalidator & jquery
dgrammatiko 7af4564
implode error
dgrammatiko 4c70552
Quotes
dgrammatiko 29c8df4
fix
dgrammatiko 63160f4
small fix
dgrammatiko d6828dd
respect the new lines
dgrammatiko 2a14685
JS CS
dgrammatiko 8103e49
Merge branch 'staging' of https://github.com/joomla/joomla-cms into _…
dgrammatiko 10b81c5
.ready()
dgrammatiko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
here also, you wrapped the
functiontoready, but why? 😉it unnecessary, there no reason to wait when DOM is ready, for define a function
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.
@Fedik you are right is not needed, but waiting for the DOM to become ready ensures that scripts will not block the DOM, which is described as best practice (is there a chance to call the function before the DOM is completed?) and will be nice if devs follow it.
Also a good reference for javascript code styling is this post in CMS Group
Of course somebody has to update the coding styles
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.
oh oh 😃
I have a doubt that writing function definition in jQuery ready() method can be a good practice, ( by link that you suggested I did not found any about it)
And I know only couple reasons when it can be not bad idea, but the current code do not related to any of these reasons 😄
Also this part of the code use nothing from jQuery, and can work very good without it 😉
And how it can block DOM? it do nothing with DOM, it just a definition.
If you do like you do, then JS parser parse
jQuery.readyand your code in it, and executejQuery.ready()for add function definition to waiting the ready event. Then onreadyevent jQuery execute your function definition.If you do as it was before, without jQuery, then JS parser parse your code and execute your function definition.
So, you still think that it will be better if all start make such thing? 😄
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.
@Fedik This is indeed, as i said before, unneeded. The reason that I put it there was just to unify the script code. So when devs tries to bring their code to 3.4 (or whenever) they see a unique pattern on the core and just follow it.
What is very interesting for admin area is that if you take a 3.3.6 and apply all those PRs, for all pages (except the edit ones where you have a modal) the page loading time decreases by 20-30%. 🎉
Just to be clear here: if people think that this is a bad practice, I can revert this code to be plain js, no prob! ❔
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.
I think, the page loading/rendering time decreases because there no mootools anymore, and for the browser do not need to parse/execute mootools library 😉
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.
@Fedik Of course you are right it is the absence of a big javascript library file that reduces the loading times. I didn’t implied that this was because of the
.ready()function 😉