Issue Details (XML | Word | Printable)

Key: MDL-17298
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Tim Hunt
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-17284

We should not add JavaScript to the YAHOO namespace

Created: 19/Nov/08 04:17 PM   Updated: 25/Nov/08 10:21 PM
Return to search
Component/s: AJAX, Quiz
Affects Version/s: 2.0
Fix Version/s: 2.0

File Attachments: 1. Text File edit_js_cleanup.patch.txt (6 kB)


Participants: Olli Savolainen and Tim Hunt
Security Level: None
Resolved date: 25/Nov/08
Affected Branches: MOODLE_20_STABLE
Fixed Branches: MOODLE_20_STABLE


 Description  « Hide
Sorry, this one is quite big. I don't know why I did not notice it before.

We really should not be adding our code to the YAHOO library namespace. I would change

YAHOO.cats.container -> question_bank
YAHOO.quiz.container -> quiz_editor

or something like that.


<div id="module" is not very descriptive. Wouldn't something like id="questionbankcontents" be better?


Do you really want to initialise on load, would onDomReady work better?

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Olli Savolainen committed 1 file to 'Moodle CVS' - 23/Nov/08 02:20 AM
quiz editing: MDL-17298 use onDOMReady instead of onload.

In the previous commit to this file (1.2) I accidentally tried to do this already, but did it wrong, so javascript dialogs did not work.
MODIFY mod/quiz/edit.js   Rev. 1.3    (+2 -1 lines)
Olli Savolainen committed 1 file to 'Moodle CVS' - 23/Nov/08 02:26 AM
quiz editing: MDL-17298 removed debugging code forgotten there in the previous revision
MODIFY mod/quiz/edit.js   Rev. 1.4    (+0 -1 lines)
tjhunt committed 2 files to 'Moodle CVS' - 25/Nov/08 09:31 PM
quiz editing: MDL-17298 We should not add JavaScript to the YAHOO namespace

Also, use the newer methods for including required JavaScript.
MODIFY mod/quiz/edit.php   Rev. 1.130    (+18 -30 lines)
MODIFY mod/quiz/edit.js   Rev. 1.5    (+12 -15 lines)