MDL-32744: Maintain format specific CSS selectors in the format configuration.

This updates existing core formats and introduce a configuration function.
This commit is contained in:
Ruslan Kabalin 2012-05-08 11:10:22 +01:00
parent 4f7f2a8828
commit 405eaac272
5 changed files with 214 additions and 46 deletions

View file

@ -5,13 +5,24 @@ M.course = M.course || {};
M.course.format = M.course.format || {};
/**
* Get section list for this format
* Get sections config for this format
*
* @param {YUI} Y YUI3 instance
* @return {string} section list selector
* The section structure is:
* <ul class="topics">
* <li class="section">...</li>
* <li class="section">...</li>
* ...
* </ul>
*
* @return {object} section list configuration
*/
M.course.format.get_section_selector = function(Y) {
return 'li.section';
M.course.format.get_config = function() {
return {
container_node : 'ul',
container_class : 'topics',
section_node : 'li',
section_class : 'section'
};
}
/**

View file

@ -5,13 +5,24 @@ M.course = M.course || {};
M.course.format = M.course.format || {};
/**
* Get section list for this format
* Get sections config for this format
*
* @param {YUI} Y YUI3 instance
* @return {string} section list selector
* The section structure is:
* <ul class="weeks">
* <li class="section">...</li>
* <li class="section">...</li>
* ...
* </ul>
*
* @return {object} section list configuration
*/
M.course.format.get_section_selector = function(Y) {
return 'li.section';
M.course.format.get_config = function() {
return {
container_node : 'ul',
container_class : 'weeks',
section_node : 'li',
section_class : 'section'
};
}
/**