mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-34737-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
17c9a3ccbf
@ -2,6 +2,10 @@ This files describes API changes for course formats
|
||||
|
||||
Overview of this plugin type at http://docs.moodle.org/dev/Course_formats
|
||||
|
||||
=== 2.8 ===
|
||||
* The activity chooser now uses M.course.format.get_sectionwrapperclass()
|
||||
to determine the section selector, rather than a hard-coded `li.section`.
|
||||
|
||||
=== 2.7 ===
|
||||
* The ->testedbrowsers array no longer needs to be defined in supports_ajax().
|
||||
* format_section_renderer_base::section_hidden has an new second optional argument $courseorid.
|
||||
|
@ -8,7 +8,7 @@ YUI.add('moodle-course-modchooser', function (Y, NAME) {
|
||||
|
||||
var CSS = {
|
||||
PAGECONTENT : 'body',
|
||||
SECTION : 'li.section',
|
||||
SECTION: null,
|
||||
SECTIONMODCHOOSER : 'span.section-modchooser-link',
|
||||
SITEMENU : 'div.block_site_main_menu',
|
||||
SITETOPIC : 'div.sitetopic'
|
||||
@ -44,6 +44,10 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
|
||||
* @method initializer
|
||||
*/
|
||||
initializer : function() {
|
||||
var sectionclass = M.course.format.get_sectionwrapperclass();
|
||||
if (sectionclass) {
|
||||
CSS.SECTION = '.' + sectionclass;
|
||||
}
|
||||
var dialogue = Y.one('.chooserdialoguebody');
|
||||
var header = Y.one('.choosertitle');
|
||||
var params = {};
|
||||
@ -75,9 +79,11 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
|
||||
}, this);
|
||||
|
||||
// Setup for standard course topics
|
||||
Y.one(baseselector).all(CSS.SECTION).each(function(section) {
|
||||
this._setup_for_section(section);
|
||||
}, this);
|
||||
if (CSS.SECTION) {
|
||||
Y.one(baseselector).all(CSS.SECTION).each(function(section) {
|
||||
this._setup_for_section(section);
|
||||
}, this);
|
||||
}
|
||||
|
||||
// Setup for the block site menu
|
||||
Y.one(baseselector).all(CSS.SITEMENU).each(function(section) {
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-course-modchooser",function(e,t){var n={PAGECONTENT:"body",SECTION:"li.section",SECTIONMODCHOOSER:"span.section-modchooser-link",SITEMENU:"div.block_site_main_menu",SITETOPIC:"div.sitetopic"},r="course-modchooser",i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,M.core.chooserdialogue,{sectionid:null,initializer:function(){var t=e.one(".chooserdialoguebody"),n=e.one(".choosertitle"),r={};this.setup_chooser_dialogue(t,n,r),this.setup_for_section(),M.course.coursebase.register_module(this),e.all(".block_settings #settingsnav .type_course .modchoosertoggle a").on("click",this.toggle_mod_chooser,this)},setup_for_section:function(t){t||(t=n.PAGECONTENT),e.one(t).all(n.SITETOPIC).each(function(e){this._setup_for_section(e)},this),e.one(t).all(n.SECTION).each(function(e){this._setup_for_section(e)},this),e.one(t).all(n.SITEMENU).each(function(e){this._setup_for_section(e)},this)},_setup_for_section:function(t){var r=t.one(n.SECTIONMODCHOOSER);if(!r)return;var i=e.Node.create("<a href='#' />");r.get("children").each(function(e){i.appendChild(e)}),r.insertBefore(i),i.on("click",this.display_mod_chooser,this)},display_mod_chooser:function(e){if(e.target.ancestor(n.SITETOPIC))this.sectionid=1;else if(e.target.ancestor(n.SECTION)){var t=e.target.ancestor(n.SECTION);this.sectionid=t.get("id").replace("section-","")}else e.target.ancestor(n.SITEMENU)&&(this.sectionid=0);this.display_chooser(e)},toggle_mod_chooser:function(t){var n=e.all("div.addresourcemodchooser"),r=e.all("div.addresourcedropdown");if(n.size()===0)return;var i=e.one(".block_settings #settingsnav .type_course .modchoosertoggle a"),s=i.get("lastChild"),o;n.item(0).hasClass("visibleifjs")?(o=0,n.removeClass("visibleifjs").addClass("hiddenifjs"),r.addClass("visibleifjs").removeClass("hiddenifjs"),s.set("data",M.util.get_string("modchooserenable","moodle")),i.set("href",i.get("href").replace("off","on"))):(o=1,n.addClass("visibleifjs").removeClass("hiddenifjs"),r.removeClass("visibleifjs").addClass("hiddenifjs"),s.set("data",M.util.get_string("modchooserdisable","moodle")),i.set("href",i.get("href").replace("on","off"))),M.util.set_user_preference("usemodchooser",o),t.preventDefault()},option_selected:function(e){this.hiddenRadioValue.setAttrs({name:"jump",value:e.get("value")+"§ion="+this.sectionid})}},{NAME:r,ATTRS:{maxheight:{value:800}}}),M.course=M.course||{},M.course.init_chooser=function(e){return new i(e)}},"@VERSION@",{requires:["moodle-core-chooserdialogue","moodle-course-coursebase"]});
|
||||
YUI.add("moodle-course-modchooser",function(e,t){var n={PAGECONTENT:"body",SECTION:null,SECTIONMODCHOOSER:"span.section-modchooser-link",SITEMENU:"div.block_site_main_menu",SITETOPIC:"div.sitetopic"},r="course-modchooser",i=function(){i.superclass.constructor.apply(this,arguments)};e.extend(i,M.core.chooserdialogue,{sectionid:null,initializer:function(){var t=M.course.format.get_sectionwrapperclass();t&&(n.SECTION="."+t);var r=e.one(".chooserdialoguebody"),i=e.one(".choosertitle"),s={};this.setup_chooser_dialogue(r,i,s),this.setup_for_section(),M.course.coursebase.register_module(this),e.all(".block_settings #settingsnav .type_course .modchoosertoggle a").on("click",this.toggle_mod_chooser,this)},setup_for_section:function(t){t||(t=n.PAGECONTENT),e.one(t).all(n.SITETOPIC).each(function(e){this._setup_for_section(e)},this),n.SECTION&&e.one(t).all(n.SECTION).each(function(e){this._setup_for_section(e)},this),e.one(t).all(n.SITEMENU).each(function(e){this._setup_for_section(e)},this)},_setup_for_section:function(t){var r=t.one(n.SECTIONMODCHOOSER);if(!r)return;var i=e.Node.create("<a href='#' />");r.get("children").each(function(e){i.appendChild(e)}),r.insertBefore(i),i.on("click",this.display_mod_chooser,this)},display_mod_chooser:function(e){if(e.target.ancestor(n.SITETOPIC))this.sectionid=1;else if(e.target.ancestor(n.SECTION)){var t=e.target.ancestor(n.SECTION);this.sectionid=t.get("id").replace("section-","")}else e.target.ancestor(n.SITEMENU)&&(this.sectionid=0);this.display_chooser(e)},toggle_mod_chooser:function(t){var n=e.all("div.addresourcemodchooser"),r=e.all("div.addresourcedropdown");if(n.size()===0)return;var i=e.one(".block_settings #settingsnav .type_course .modchoosertoggle a"),s=i.get("lastChild"),o;n.item(0).hasClass("visibleifjs")?(o=0,n.removeClass("visibleifjs").addClass("hiddenifjs"),r.addClass("visibleifjs").removeClass("hiddenifjs"),s.set("data",M.util.get_string("modchooserenable","moodle")),i.set("href",i.get("href").replace("off","on"))):(o=1,n.addClass("visibleifjs").removeClass("hiddenifjs"),r.removeClass("visibleifjs").addClass("hiddenifjs"),s.set("data",M.util.get_string("modchooserdisable","moodle")),i.set("href",i.get("href").replace("on","off"))),M.util.set_user_preference("usemodchooser",o),t.preventDefault()},option_selected:function(e){this.hiddenRadioValue.setAttrs({name:"jump",value:e.get("value")+"§ion="+this.sectionid})}},{NAME:r,ATTRS:{maxheight:{value:800}}}),M.course=M.course||{},M.course.init_chooser=function(e){return new i(e)}},"@VERSION@",{requires:["moodle-core-chooserdialogue","moodle-course-coursebase"]});
|
||||
|
@ -8,7 +8,7 @@ YUI.add('moodle-course-modchooser', function (Y, NAME) {
|
||||
|
||||
var CSS = {
|
||||
PAGECONTENT : 'body',
|
||||
SECTION : 'li.section',
|
||||
SECTION: null,
|
||||
SECTIONMODCHOOSER : 'span.section-modchooser-link',
|
||||
SITEMENU : 'div.block_site_main_menu',
|
||||
SITETOPIC : 'div.sitetopic'
|
||||
@ -44,6 +44,10 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
|
||||
* @method initializer
|
||||
*/
|
||||
initializer : function() {
|
||||
var sectionclass = M.course.format.get_sectionwrapperclass();
|
||||
if (sectionclass) {
|
||||
CSS.SECTION = '.' + sectionclass;
|
||||
}
|
||||
var dialogue = Y.one('.chooserdialoguebody');
|
||||
var header = Y.one('.choosertitle');
|
||||
var params = {};
|
||||
@ -75,9 +79,11 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
|
||||
}, this);
|
||||
|
||||
// Setup for standard course topics
|
||||
Y.one(baseselector).all(CSS.SECTION).each(function(section) {
|
||||
this._setup_for_section(section);
|
||||
}, this);
|
||||
if (CSS.SECTION) {
|
||||
Y.one(baseselector).all(CSS.SECTION).each(function(section) {
|
||||
this._setup_for_section(section);
|
||||
}, this);
|
||||
}
|
||||
|
||||
// Setup for the block site menu
|
||||
Y.one(baseselector).all(CSS.SITEMENU).each(function(section) {
|
||||
|
14
course/yui/src/modchooser/js/modchooser.js
vendored
14
course/yui/src/modchooser/js/modchooser.js
vendored
@ -6,7 +6,7 @@
|
||||
|
||||
var CSS = {
|
||||
PAGECONTENT : 'body',
|
||||
SECTION : 'li.section',
|
||||
SECTION: null,
|
||||
SECTIONMODCHOOSER : 'span.section-modchooser-link',
|
||||
SITEMENU : 'div.block_site_main_menu',
|
||||
SITETOPIC : 'div.sitetopic'
|
||||
@ -42,6 +42,10 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
|
||||
* @method initializer
|
||||
*/
|
||||
initializer : function() {
|
||||
var sectionclass = M.course.format.get_sectionwrapperclass();
|
||||
if (sectionclass) {
|
||||
CSS.SECTION = '.' + sectionclass;
|
||||
}
|
||||
var dialogue = Y.one('.chooserdialoguebody');
|
||||
var header = Y.one('.choosertitle');
|
||||
var params = {};
|
||||
@ -73,9 +77,11 @@ Y.extend(MODCHOOSER, M.core.chooserdialogue, {
|
||||
}, this);
|
||||
|
||||
// Setup for standard course topics
|
||||
Y.one(baseselector).all(CSS.SECTION).each(function(section) {
|
||||
this._setup_for_section(section);
|
||||
}, this);
|
||||
if (CSS.SECTION) {
|
||||
Y.one(baseselector).all(CSS.SECTION).each(function(section) {
|
||||
this._setup_for_section(section);
|
||||
}, this);
|
||||
}
|
||||
|
||||
// Setup for the block site menu
|
||||
Y.one(baseselector).all(CSS.SITEMENU).each(function(section) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user