EGreg / Platform-history

The Qbix Platform for powering Social Applications
http://qbix.com/platform
GNU Affero General Public License v3.0
21 stars 5 forks source link

Improve scriptsInline and stylesheetsInline #26

Open EGreg opened 10 years ago

EGreg commented 10 years ago

Right now the files are included verbatim. Instead, we should be including the results of compiling CSS and JS files with combine.php . This will do things like resolve relative paths in CSS, minify, etc.

This is probably already done since Q_Html::themedUrlAndFilename() already considers the "Q"/"environment" config field. Test it by setting up an Q/environments/live config field -- if so, we are almost good to go.

The only question is what should happen when the combine.php hasn't run, but the scripts and stylesheets are included inline. In this case, I guess we should break out the "relative urls" processing of Q_filters_reducisaurus into a separate function inside Q_Html or Q_Utils and call it in the inlineScripts, but only if there is no environment selected in the config. To understand how to break it out, study the fields parts and dest sent by combine.php and how the Q_filters_reducisaurus constructs the relative paths, in order to move this into its own function.