|
As a note this patch reduces the amount of JavaScript being loaded in the head by about 32KB and slims down the overall JavaScript payload by 15KB for pages that don't use formslib
Concept sounds good! I don't know if anything unexpected might break but assuming it doesn't (or that can be corrected easily) then +1 from me!
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
This is done in several methods:
1. A couple of functions that were being used by only one module have been moved to JS files being included by those modules only
2. Several functions that were only being used by formslib have been split into a separate file lib/form/form.js
at the same time I also tidied up the JavaScript that formslib was serving in the corresponding places.
3. Deprecated a couple of JavaScript functions that weren't being used within Moodle at all.
4. Changed javascript-static to load in the page footer rather than the head
5. Created javascript-static-priority and moved several functions that were required (within at least one call) to be loaded in the head into javascript-static-priority and made output-render load the file in head.
If someone could please have a look at this patch and let me know if it is OK to commit that would be fantastic.
Cheers
Sam