? ? Pending

User tests: Successful: Unsuccessful:

avatar tonypartridge
tonypartridge
22 Sep 2017

Function the same way as custom.css file but for JavaScript.

avatar joomla-cms-bot joomla-cms-bot - change - 22 Sep 2017
Category Administration Templates (admin)
avatar tonypartridge tonypartridge - open - 22 Sep 2017
avatar tonypartridge tonypartridge - change - 22 Sep 2017
Status New Pending
avatar dgt41
dgt41 - comment - 22 Sep 2017

@tonypartridge What is that you might want to include in the template level?
I'll say this is not a good idea

avatar tonypartridge
tonypartridge - comment - 22 Sep 2017

I knew you would say that!! For certain scenarios when you say need to move a field around in a component and you can write a little bit of JavaScript to handle this. Instead of a template override it's easier to future proof it with a little JS.

It's similar to CSS, but allows more tweaks and is easily noticeable that the JS file has been loaded which debugging any issues etc.

avatar brianteeman brianteeman - test_item - 24 Sep 2017 - Tested successfully
avatar brianteeman
brianteeman - comment - 24 Sep 2017

I have tested this item successfully on afc3642

Seems a logical improvement to me


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18062.

avatar tonypartridge tonypartridge - change - 26 Sep 2017
Labels Added: ?
avatar GeraintEdwards GeraintEdwards - test_item - 26 Sep 2017 - Tested successfully
avatar GeraintEdwards
GeraintEdwards - comment - 26 Sep 2017

I have tested this item successfully on 694bc8c

Tested without custom.js file and no problems

Tested with custom.js file present and it was loaded and executed.

Seems a logical extension of the custom css loading mechanism.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18062.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Sep 2017

@brianteeman can you please test again?

avatar brianteeman brianteeman - test_item - 26 Sep 2017 - Tested successfully
avatar brianteeman
brianteeman - comment - 26 Sep 2017

I have tested this item successfully on 694bc8c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18062.

avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Sep 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Sep 2017

RTC after two successful tests.

avatar tonypartridge
tonypartridge - comment - 4 Oct 2017

would be nice for 3.8.1 @mbabker 😉

avatar mbabker
mbabker - comment - 4 Oct 2017

Features don't go into patch releases.

avatar ghazal ghazal - test_item - 16 Oct 2017 - Tested successfully
avatar ghazal
ghazal - comment - 16 Oct 2017

I have tested this item successfully on 694bc8c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18062.

avatar tonypartridge tonypartridge - change - 2 Apr 2018
Labels Added: ?
avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

@mbabker any suggestions on satisfying drone? Failing on Firefox but I haven't changed any JS.

avatar mbabker
mbabker - comment - 2 Apr 2018

Drone as a CI platform and JavaScript testing as a whole are not in my areas of expertise.

avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

@yvesh any suggestions kind sir...

avatar dgt41
dgt41 - comment - 2 Apr 2018

Instead of a template override it's easier to future proof it with a little JS.

@tonypartridge Please no! Template is just a shell that in a perfect world should have 0 lines of HTML, shouldn't impose any CSS files OR javascript files! I perfectly understand that it's easier to add some js there and have it available everywhere but this approach will not fly anymore in 2018. We need to write better code instead of using ideas/shortcuts to write easy code!

avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

And that’s all good a well if you are the developer creating the component, I 100% agree.

But not all Joomla! Extensions are perfect. And need some JS, for instance say set some default values. Make some ordering changes because say the component doesn’t do it in the template file and instead do it in the view file.

This is a solution which allows you to refine extensions which are not perfect, or to make UX better for your client adding stuff. The exact same reason as loading in custom css.

On 2 Apr 2018, 21:05 +0100, Dimitri Grammatikogianni notifications@github.com, wrote:

Instead of a template override it's easier to future proof it with a little JS.
@tonypartridge Please no! Template is just a shell that in a perfect world should have 0 lines of HTML, shouldn't impose any CSS files OR javascript files! I perfectly understand that it's easier to add some js there and have it available everywhere but this approach will not fly anymore in 2018. We need to write better code instead of using ideas/shortcuts to write easy code!

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar dgt41
dgt41 - comment - 2 Apr 2018

@tonypartridge this approach will not fly in J4 because all fields that have some js interaction will be (most are already, or there is a PR) custom elements. In that sense your proposed script needs to go after those scripts, but those scripts are easy loaded...

avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

Ive not looked into J4, but essentially your saying we can’t load JS without custom elements?

On 2 Apr 2018, 21:12 +0100, Dimitri Grammatikogianni notifications@github.com, wrote:

@tonypartridge this approach will not fly in J4 because all fields that have some js interaction will be (most are already, or there is a PR) custom elements. In that sense your proposed script needs to go after those scripts, but those scripts are easy loaded...

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar dgt41
dgt41 - comment - 2 Apr 2018

And that’s all good a well if you are the developer creating the component, I 100% agree.

This makes 0 sense. If you're not a developer, so you don't really understand what the js is doing, for security and many other reasons you shouldn't be able to add javascript. Or any kind of code!

avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

No you are miss understanding. IF you are not the Developer of the component you wish to make a change too.

On 2 Apr 2018, 21:14 +0100, Dimitri Grammatikogianni notifications@github.com, wrote:

And that’s all good a well if you are the developer creating the component, I 100% agree.
This makes 0 sense. If you're not a developer, so you don't really understand what the js is doing, for security and many other reasons you shouldn't be able to add javascript. Or any kind of code!

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar dgt41
dgt41 - comment - 2 Apr 2018

@tonypartridge give me a real example that this is not possible right now in joomla with simple layout overrides...

avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

I give up.

avatar tonypartridge tonypartridge - change - 2 Apr 2018
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2018-04-02 20:20:38
Closed_By tonypartridge
avatar tonypartridge tonypartridge - close - 2 Apr 2018
avatar mbabker
mbabker - comment - 2 Apr 2018

I get what your intent here is, but this is really something where you need to be doing layout overrides of the affected component screens, not adding a global JS file to the template. The custom CSS file is quick fixes for personalizing the appearance, it's not changing functionality, whereas a custom JS file changes functionality. That needs a lot more scrutiny in general.

avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

Which is great when the component allows overrides. Not all do, not all follow MVC.

As said I give up, I’ll just continue using custom plugins to inject it where needed.

On 2 Apr 2018, 21:23 +0100, Michael Babker notifications@github.com, wrote:

I get what your intent here is, but this is really something where you need to be doing layout overrides of the affected component screens, not adding a global JS file to the template. The custom CSS file is quick fixes for personalizing the appearance, it's not changing functionality, whereas a custom JS file changes functionality. That needs a lot more scrutiny in general.

You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar mbabker
mbabker - comment - 2 Apr 2018

Ahh, more extensions for my personal blacklist then 😉

avatar tonypartridge
tonypartridge - comment - 2 Apr 2018

Ahaha

On 2 Apr 2018, 21:30 +0100, Michael Babker notifications@github.com, wrote:

Ahh, more extensions for my personal blacklist then 😉

You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

Add a Comment

Login with GitHub to post a comment