Subject:*
Name/Email:*
Message Icon:*
Message:*
url email imgsrc image php hide code quote
SAMPLE
alignleft aligncenter alignright bold italic underline linethrough   


 [more...]
Options:*
 

 

 
View requirements*
Reply No requirement
Confirmation Code*
  The code is case-insensitive  Click the image for a new code. | Maximum attempts: 8
   
Re: Where does the core inject all this javascript?

by skenow on 2020/1/29 19:08:02

There are minify and combine functions in the core - and currently left unused. Mostly because the resulting file was placed in the cache/ folder and at least one of the js and css files had some specific paths that didn't work when the file was in a different location.


Re: Where does the core inject all this javascript?

by fiammybe on 2020/1/29 8:10:10

I found the locations in the header file where all the different files were loaded, and I included a switch statement so that I can switch the way includes are done by simply defining a boolean in the theme. When the boolean is true, I include a file 'combined.js' and 'combined.css', which are combined and minified versions of the different javascript and CSS files that are included at the moment. Whent he boolean is false, the old behaviour is still there.

This reduces considerably the loading time (first time at least) of a page. I still have some small issues with the minifying, but I think I have identified the problem.


Re: Where does the core inject all this javascript?

by skenow on 2020/1/8 18:49:25

icms_core_theme_Object does all the work, but the work to be done is defined in /header.php. Just search for ->addScript and ->addStylesheet

include/cp_functions:: icms_cp_header() creates the work for the admin area.

 


Re: Where does the core inject all this javascript?

by fiammybe on 2020/1/7 23:42:32

The billboard module needs major updates and it is no longer used on the site at the moment.

I'll look into the icms_view_theme_Object, because I want to understand where the different javascript and CSS files get included in the core. I believe some of them are not needed on every page. 


Re: Where does the core inject all this javascript?

by skenow on 2020/1/7 9:51:28

This is the question I had in the slack channel - "async deferred" can be used to move when the javascript is loaded. The actual place is during the renderMetas method of icms_view_theme_Object.

This works for most things and I have it running this way on several sites. The Billboard module does not work properly on the initial page load and renders separate images for each slide until you refresh (works sometimes)