Issue Details (XML | Word | Printable)

Key: MDL-19503
Type: Sub-task Sub-task
Status: Open Open
Priority: Minor Minor
Assignee: moodle.com
Reporter: Tim Hunt
Votes: 0
Watchers: 1
Operations

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

Clean up grader report JavaScript

Created: 15/Jun/09 01:34 PM   Updated: 13/Nov/09 04:08 PM
Return to search
Component/s: Gradebook
Affects Version/s: 2.0
Fix Version/s: 2.0

Participants: Matt Gibson, moodle.com and Tim Hunt
Security Level: None
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
I know the gradebook was probably written first, but the JavaScript really needs to be updated to match http://docs.moodle.org/en/Development:JavaScript_guidelines. In particular

1. Putting Moodle code in the YAHOO namespace seems evil to me.
2. Almost all the code should be in external JS files not in the HTML, there seems to be a lot of JS in grade/report/grader/index.php
3. Related to that, the JS should be includable from the page footer, but becuase of the inline script, it isn't. See the todo on lnie 119 of grade/report/grader/index.php.

I was hoping you could fix these problems more easily than me, so assigning to you Nico, I hope that is OK.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Matt Gibson added a comment - 25/Jun/09 06:50 PM
Tim, re: 1...

Is this (or will it soon be) an overall coding guideline type of thing? I've been adding more YAHOO namespaced stuff and also was about to start for my own projects. It seemed to be a good idea as the YAHOO.namespace() function checks for collisions and acts as a nice substitute for using globals.

Should I avoid this?


Matt Gibson added a comment - 25/Jun/09 06:50 PM
Tim, re: 1...

Is this (or will it soon be) an overall coding guideline type of thing? I've been adding more YAHOO namespaced stuff and also was about to start for my own projects. It seemed to be a good idea as the YAHOO.namespace() function checks for collisions and acts as a nice substitute for using globals.

Should I avoid this?


Tim Hunt added a comment - 25/Jun/09 09:12 PM
The whole point of a name space is for different libraries to keep everything in their own private area, so names do not collide.

Therefore, it is definitely wrong for us to shove stuff into the YAHOO namespace.

The docs page I linked to above is now part of the coding guidelines.


Matt Gibson added a comment - 25/Jun/09 09:54 PM
Cool.

Thanks.