User tests: Successful: Unsuccessful:
Function the same way as custom.css file but for JavaScript.
Category | ⇒ | Administration Templates (admin) |
Status | New | ⇒ | Pending |
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.
I have tested this item
Seems a logical improvement to me
Labels |
Added:
?
|
I have tested this item
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.
@brianteeman can you please test again?
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC after two successful tests.
Features don't go into patch releases.
I have tested this item
Labels |
Added:
?
|
Drone as a CI platform and JavaScript testing as a whole are not in my areas of expertise.
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!
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.
@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...
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.
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!
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.
@tonypartridge give me a real example that this is not possible right now in joomla with simple layout overrides...
I give up.
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-04-02 20:20:38 |
Closed_By | ⇒ | tonypartridge |
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.
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.
Ahh, more extensions for my personal blacklist then
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.
@tonypartridge What is that you might want to include in the template level?
I'll say this is not a good idea