You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
1.2 KiB

define(["jquery","core/str","core/notification"],function(a,b,c){"use strict";var d={ACTIONAREA:".actions"},e={EDITINPROGRESS:"editinprogress"},f=function(a){var b="";return Y.use("moodle-course-util",function(c){b=c.Moodle.core_course.util.cm.getName(c.Node(a.get(0)))}),b},g=function(a,d){var e=a.attr("class").match(/modtype_([^\s]*)/)[1],g=f(a);b.get_string("pluginname",e).done(function(a){var e={type:a,name:g};b.get_strings([{key:"confirm"},{key:null===g?"deletechecktype":"deletechecktypename",param:e},{key:"yes"},{key:"no"}]).done(function(a){c.confirm(a[0],a[1],a[2],a[3],d)}).fail(c.exception)})},h=function(a){a.addClass(e.EDITINPROGRESS);var b=a.find(d.ACTIONAREA).get(0);if(b){var c=M.util.add_spinner(Y,Y.Node(b));return c.show(),c}return null},i=function(a){var b=M.util.add_lightbox(Y,Y.Node(a.get(0)));return b.show(),b},j=function(a,b,c){window.setTimeout(function(){a.removeClass(e.EDITINPROGRESS),b&&b.hide()},c)},k=function(a,b){a&&window.setTimeout(function(){a.hide()},b)};return{confirmDeleteModule:function(a,b){g(a,b)},removeLightbox:function(a,b){k(a,b)},removeSpinner:function(a,b,c){j(a,b,c)},getModuleName:function(a){f(a)},addSectionLightbox:function(a){i(a)},addActivitySpinner:function(a){h(a)}}});