?
avatar dgt41
dgt41
30 Jul 2014

On the quest to make Joomla! compatible with bootstrap 3 (or foundation) I encounter a problem (among others) on the front end: the rendered messages. Ok there is a solution: unset core.js and place a copy of the modified in the head, but wouldn’t be better if the javascript code that sets and destroys the messages been added with $doc->addScriptDeclaration(‘code’); on the layout view?

If the idea gets some :+1: I will provide the code

avatar dgt41 dgt41 - open - 30 Jul 2014
avatar mbabker
mbabker - comment - 30 Jul 2014

The entirety of core.js can be overridden with a template override too. Copy it from media/system/js/core.js to templates/<template>/js/system/core.js and you're all set (you'd need to do the same with the uncompressed file). Just one option to throw out there.

avatar dgt41
dgt41 - comment - 30 Jul 2014

Thanks @mbabker for clarifying on the best way to override assets.
I guess I was doing it the old (wrong) way, again!
But, what I am asking, actually, is if it would be better to make core.js more modular with one solution putting the code to several scripts or inject the code directly in the respected layouts.
The later has one advantage for front end devs: in one file you make all the changes
e.g: on
https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/system/message.php
you can set the format of html code and adjust the javascript to produce that exact code!

avatar wilsonge
wilsonge - comment - 30 Jul 2014

There's a b/c issue with adding js into something that's override able (we had the same kind of issue in 2.5 and caption.js) but fwiw I agree with the principle.

avatar Bakual
Bakual - comment - 31 Jul 2014

One could maybe do it in the message JLayout. But that is quite a new file and most templates probably don't use it yet.
If you now remove the code from core.js and move it into the JLayout, it would break that functionality for more or less all existing sites.
Also you can't both leave it in core.js and add it to the JLayout because the duplicate code will probably clash.

So while the idea is good, I don't think we can do it in a B/C way.
Or do you see how it could be done?

avatar dgt41 dgt41 - close - 31 Jul 2014
avatar dgt41 dgt41 - change - 31 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-31 17:00:34
avatar dgt41 dgt41 - close - 31 Jul 2014
avatar Bakual Bakual - close - 31 Jul 2014
avatar dgt41
dgt41 - comment - 1 Aug 2014

@wilsonge, @Bakual
Ok I can not think of a SIMPLE implementation on this without breaking b/c. So no go for 3.x
But can I ask for a "revaluate for 4" label?

avatar Bakual Bakual - change - 1 Aug 2014
Status Closed New
Labels Added: ?
avatar Bakual
Bakual - comment - 1 Aug 2014

Added the label :smile:

avatar zero-24 zero-24 - change - 24 Aug 2015
Milestone Added:
avatar zero-24 zero-24 - change - 24 Aug 2015
Milestone Added:

Add a Comment

Login with GitHub to post a comment