-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Remove jQuery dependency from core.js #5257
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
Conversation
|
@test success When deleting the msgs we end up with a lot of white space, I guess this happens only in the test env? |
|
In fact it was a chrome bug :( Thanks for testing it should work now. |
|
will retest in the morning |
|
test |
|
@test success |
|
Can we remove the call to jQuery in JHtmlBehaviour::core(); as part of this then please? |
|
@wilsonge But |
If core.js doesn't need jQuery anymore, then remove the call to jQuery.
Nah. |
|
@wilsonge @Bakual Removing https://github.com/joomla/joomla-cms/blob/staging/libraries/cms/html/behavior.php#L88 didn’t broke something, so I guess you are both right here! |
|
Good catch @wilsonge :) I think this is perfect now. |
|
@phproberto don’t commit this one yet… I am sending you a PR... |
Good catch :)
|
I merged @DGT41's PR 👍 |
|
Merged, thanks! |




This solves #5254
Issue description
I was checking
core.jsand noticed that we have added there some jQuery code in functions:Joomla.renderMessagesand
Joomla.removeMessagesThey are mainly used on install and overrider but also third part developers can be using them.
We officially support jQuery & Mootools even being migrating to jQuery. Adding that code causes that developers that want to use only Mootools are forced to load jQuery.
So we have to convert them to plain JS.
How to test
As it's hard to test message rendering in installation & language overrides here is some code that you can use. You have to add this code before applying the patch and test it before and after the patch to be sure that it's working the same.
I will explain how to put testing code in the articles view (
administrator/components/com_content/views/articles/tmpl/default.php). Around line 54 add:Then before line 66 (after the main container tag) add the buttons that will trigger the actions:
You will see something like:

Render messagesbutton should display the messages.Clear messagesbutton should remove the messages.View with the messages loaded: