User tests: Successful: Unsuccessful:
Currently, when we want to load core.js
(kind of our own Joomla JavaScript "library") we use the same function as when we want to load the MooTools JavaScript library. That is JHtml::_('behavior.framework')
.
So far this wasn't a problem since core.js needed MooTools anyway.
Since now core.js is rewritten to jQuery, that JHtml method also has to load the jQuery framework.
This PR will introduce a new function JHtml::_('behavior.core')
which is supposed to only load core.js. Since core.js depends on jQuery, it will also load jQuery. If we ever decide to rewrite core.js so it doesn't use jQuery anymore, this method could be changed easy to not loading jQuery anymore.
This only introduces the new method. To test, you need to manually change the call JHtml::_('behavior.framework')
to JHtml::_('behavior.core')
where possible and see that mootools is now longer loaded but core.js still is.
A good place to test would be the com_content category view with the table layout.
Change this line https://github.com/joomla/joomla-cms/blob/3.3-dev/components/com_content/views/category/tmpl/default_articles.php#L14 to JHtml::_('behavior.core')
.
Currently it will load mootools together with core.js.
If you comment the line out, neither will be loaded and the sorting function (clicking on table headers) will be broken.
Changing it to behavior.core will load core.js without mootools and the sorting will work (again).
When testing make sure you disable modules. They may load mootools as well (login for example does).
This will also be needed work for future PRs to change the current calls and remove the (hopefully
now) unneeded loading of Mootools.
My goal is to introduce this method now so it can be used as a base for future PRs.
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32994
This is basically the same as PR #3047, but now against 3.3 and taking into account that core.js is rewritten now.
Updated initial comment with a test case (com_content, category view)
#. I installed the latest 3.3 dev
#. I installed the patch
#. I went to Article Category LIst on the front end, and confirmed both mootools and core.js was loading
#. I edited components/com_content/views/category/tmpl/default_articles.php and changed behavior.framework to behavior.core
#. I refreshed the Article Category List page, and confirmed mootools was not loading, but core.js was
#. I tested the sorting features on the Article Category LIst page and it worked.
You may blame the J!Tracker Application for transmitting this comment.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-03-26 21:34:37 |
Fixed UnitTests.