| 12 | | |
| 13 | | === Compress JS & CSS files === |
| 14 | | Browsers default to only downloading 2 files from the same origin at a time, so many files is very slow on high latency links.[[BR]] |
| 15 | | We therefore consolidate into fewer, larger files when running in Production mode. |
| 16 | | |
| 17 | | Since GIS is a specialised app which requires many files, it's JS & CSS are loaded separately when required. |
| 18 | | |
| 19 | | The build script is {{{static/scripts/tools/build.sahana.py}}}[[BR]] |
| 20 | | There is also a convenience wrapper for Windows to run this & also move results into their respective locations: {{{static/scripts/tools/build.cmd}}} |
| 21 | | |
| 22 | | NB {{{sahana.css}}} is built from {{{template.css}}} so that [wiki:ConfigurationGuidelines#Themes Themes] can be updated dynamically from the WebUI |
| 23 | | |
| 24 | | Need to remove the '@' from '@requires' in header of {{{/static/S3/jquery.form.js}}} as we need to compress this without the main file. |
| 25 | | |
| 26 | | Our build process is based on the one used by !MapFish (which is built on the one used by !OpenLayers) |
| 27 | | * !MapFish (inc OL): https://trac.mapfish.org/trac/mapfish/wiki/HowToBuild |
| 28 | | * !OpenLayers: http://trac.openlayers.org/wiki/Profiles |
| 29 | | |
| 30 | | !ToDo: Investigate using other options instead: |
| 31 | | * http://developer.yahoo.com/yui/compressor/ |
| 32 | | * http://www.crowproductions.de/repos/main/public/packer/jspacker.py |