? ? Failure

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
24 Feb 2017

Pull Request for Issue # .

Summary of Changes

  • Drop the separate arrays for inline scripts and styles
  • The data will be merged in the relative scrips and styleSheets arrays (can we remove the underscore???)
  • Make JHTML compatible with these changes

Testing Instructions

Apply patch and observe the produced head, inline scripts should be between script tags with src, same for the styles
Also the jQuery.noConflict(); should be inline and not a file...

Update to JHtml

for inline script:

JHtml::_('script', '', ['inline' =>content for inline script’]);

For inline style:

JHtml::_('stylesheet', '', ['inline' =>content for inline script’]);

Actual result

Check the structure of the head:
screen shot 2017-02-24 at 23 56 37

Documentation Changes Required

YUP!

@wilsonge @mbabker @yvesh

avatar dgt41 dgt41 - open - 24 Feb 2017
avatar dgt41 dgt41 - change - 24 Feb 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2017
Category Libraries
avatar dgt41 dgt41 - change - 24 Feb 2017
The description was changed
avatar dgt41 dgt41 - edited - 24 Feb 2017
avatar dgt41 dgt41 - change - 24 Feb 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2017
Category Libraries Libraries JavaScript
avatar dgt41 dgt41 - edited - 24 Feb 2017
avatar wilsonge
wilsonge - comment - 25 Feb 2017

Ok so what's the advantage of this? Like if I was building JDocument from scratch i would probably do something like this. But I don't see the advantage of changing the ordering that inline scripts/styles and files get loaded given how long it's been this way at this point

avatar dgrammatiko
dgrammatiko - comment - 25 Feb 2017

Two simple examples to point out how the system fails badly with its current architecture:
CSS
com_something, loads:

  • bootstrap.css: .btn { background-color: white;}
  • inline css: .btn { background-color: black;}
    mod_something loads mod.css with .btn { background-color: red;}

Expected colour red, actual black

JS
com_something, loads:

  • core.js Joomla.SubmitForm = function1
  • inline script Joomla.SubmitForm = function2
    mod_something loads mod.js with Joomla.SubmitForm = function3

Expected function3, actual function2

Both Css and JS need to be appended in the order they had been inserted... :)

avatar dgrammatiko
dgrammatiko - comment - 13 Mar 2017

I guess this won't go anywhere, closing

avatar dgt41 dgt41 - change - 13 Mar 2017
The description was changed
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-03-13 12:10:31
Closed_By dgt41
avatar dgt41 dgt41 - close - 13 Mar 2017
avatar dgrammatiko dgrammatiko - change - 12 Jan 2019
Status Closed New
Closed_Date 2017-03-13 12:10:31
Closed_By dgt41
avatar dgrammatiko dgrammatiko - change - 12 Jan 2019
Status New Pending
avatar dgrammatiko dgrammatiko - reopen - 12 Jan 2019
avatar dgrammatiko
dgrammatiko - comment - 12 Jan 2019

@wilsonge @yvesh @mbabker can we reconsider this one, if I do it in a B/C way?
Reason: I'm trying to utilise type="module" nomodule in my apps but I need some inline polyfill for Safari 10.1 which is impossible to do right now without slipping out of the API...

avatar dgrammatiko
dgrammatiko - comment - 9 Mar 2019

Closing, obviously Joomla 4 will be out of sync with the current Javascript and as people keep telling me I shouldn't run after unicorns (in this case js modules)...

avatar dgrammatiko dgrammatiko - change - 9 Mar 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-03-09 21:00:30
Closed_By dgrammatiko
avatar dgrammatiko dgrammatiko - close - 9 Mar 2019

Add a Comment

Login with GitHub to post a comment