Use YUI event delegation to handle events in course section "toolboxes" (visibility and highlight toggles) rather than attaching event handlers to each individual button we care about. Also remove the (now unused) replace_button() function.
Use YUI event delegation to handle events in course resource "toolboxes" (sets of editing icons) rather than attaching event handlers to each individual button we care about. Don't waste time setting the CSS cursor to what it already is, use .all() rather than replace_button() if we just need the node.
Section toolboxes could probably also be done this way to some extent, but the payoff may not be worth the effort - they're so minimal that they don't tend to cause issues.
Use YUI's DragDrop delegates for course dragdrop, rather than initialising a Drag object for each individual section and each individual activity/resource. Also, clone a single drag handle for activities/resources, rather than repeatedly creating a whole new one with the same parameters for each activity/resource.
Rather than calculate the sectionid for the activity chooser on page load,
we do so when opening the chooser. This resolves issues where sections have
been moved without swapping all of the section IDs around.
Initially, the default section title was swapped within the course format
javascript functions. Though some section titles may be custom and does not
require swapping, in addition they may have links to single section view. This
introduces some callback functions for define what needs to be done in
sections libs and js files.
These changes fix several points and suggested changes:
* increase the size of the help popup to 800x600
* fix issues with centering of the dialogue
* swap next/cancel buttons
* convert next button to use string for 'Add'
* convert add text to 'Add an activity or resource'
* Change markup way from 'activity module style' to its own markup
* Remove 'a new' from the 'add an activity' string
* Remove the 'personalisation' from the nohelp lang string
Using topics format as default is not a great idea, as we can end up
half-working dragdrop for some formats. With the current soiution, drag-drop
will not work for format, unless required js functions have been created in
format.js
It allows to define M.course.format.swap_sections and
M.course.format.get_section_selector in the course format javascript file, so
that course dragdrop is aware about perculiar layout and changes that need to
be done when sections are swapped.