Issue Details (XML | Word | Printable)

Key: MDL-16699
Type: Sub-task Sub-task
Status: In Progress In Progress
Priority: Minor Minor
Assignee: Sam Hemelryk
Reporter: Tim Hunt
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-16583

Split javascript-static.js into a small file included in <head> and the rest that can be included in the footer

Created: 26/Sep/08 01:54 PM   Updated: 30/Sep/09 04:33 PM
Return to search
Component/s: Lib
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: 1. Text File javascript.cleanup.20090921.patch (71 kB)


Participants: Martin Dougiamas, Sam Hemelryk and Tim Hunt
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Tim Hunt made changes - 18/Jun/09 03:57 PM
Field Original Value New Value
Assignee Tim Hunt [ timhunt ] Sam Hemelryk [ samhemelryk ]
Sam Hemelryk added a comment - 21/Sep/09 01:38 PM
I've uploaded a patch here that cleans up the JavaScript that was being served within javascript-static.
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


Sam Hemelryk made changes - 21/Sep/09 01:38 PM
Attachment javascript.cleanup.20090921.patch [ 18411 ]
Sam Hemelryk added a comment - 21/Sep/09 01:42 PM
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

Sam Hemelryk made changes - 21/Sep/09 01:45 PM
Status Open [ 1 ] In Progress [ 3 ]
Martin Dougiamas added a comment - 30/Sep/09 04:33 PM
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!