akeeba / fof

Rapid Application Development framework for Joomla!™ 3 and 4
0 stars 0 forks source link

Refactor common view templates and FEF Helpers to avoid inline events and jQuery #697

Closed nikosdion closed 3 years ago

nikosdion commented 3 years ago

The common view templates and the FEF Helpers currently use inline event handlers and/or jQuery. We need to rewrite them to use the common JavaScript library and on DOM content loaded head scripts instead.

Now that Joomla 4 has moved to Bootstrap 4 which no longer uses jQuery (Joomla's last jQuery hard dependency) it is very likely that Joomla itself may drop support for jQuery like it did for mooTools in the past when it was no longer necessary for core features. As a precautionary measure we should rewrite our JavaScript to use our common JS library, now part of Akeeba FEF 2.x, instead of relying jQuery.

We must no longer use inline event handlers (attributes like onclick). The reason for that is that Joomla 4 ships with an optional feature to apply a content security policy which might break inline attributes' event handlers as they are not signed with a nonce.

We should make sure we no longer use inline JS to pass around configuration variables from the server side to the client side. Akeeba FEF 2 uses the same concept as Joomla 3.x for passing options from the server side to the client side using a JSON document in a non-executable Githubissues.

  • Githubissues is a development platform for aggregating issues.