%PDF- %PDF-
| Direktori : /opt/bitnami/apps/moodle/htdocs/course__d9c9c01/format/tiles/amd/build/ |
| Current File : /opt/bitnami/apps/moodle/htdocs/course__d9c9c01/format/tiles/amd/build/edit_course_mod.min.js |
define ("format_tiles/edit_course_mod",["jquery","core/ajax","core/templates","core/notification","core/str","core/url","core/config"],function(a,b,c,d,e,f,g){"use strict";var h={},i=a("html,body"),j=a("#page"),k={MENU_ACTION:".menu-action-text",SUBTILE:".subtile",SPACER:".spacer",AVAIL_INFO:".availabilityinfo",ACTIVITY_INSTANCE:".subtile-activityinstance",INSTANCE_NAME:".instancename",SECTION_CM_EDIT_ACTIONS:".section-cm-edit-actions",EDITING_MOVE:".editing_move",LABEL_CONVERT:".editing_labelconvert",CM_EDIT_ACTION:".cm-edit-action",ACTIVITY_ICON:".activityicon",EDITING_DELETE:".editing_delete",SECTION_MAIN:".section.main",STEALTH_UNAVAIL_LINK:".editing_makeunavailable"},l={SHOW:"show",HIDE:"hide",FA_EYE_SLASH:"fa-eye-slash",FA_EYE:"fa-eye",DIMMED:"dimmed",EDITING:"editing_",ACTIVITY:"activity",LABEL:"label",SECTION_DRAGGABLE:"sectiondraggable"},m={CLICK:"click",MODULE_ADDED:"filter-content-updated",MOUSEDOWN:"mousedown"},n=function(c){var d=a(c.currentTarget),e;if("tiles-hide"===d.attr("data-action")){e={changeTo:l.HIDE,old:l.SHOW};a(k.STEALTH_UNAVAIL_LINK).hide()}else if("tiles-show"===d.attr("data-action")){e={changeTo:l.SHOW,old:l.HIDE}}if(e){c.preventDefault();d.attr("data-action","tiles-"+e.old);var f=b.call([{methodname:"core_course_edit_module",args:{id:d.attr("data-cmid"),action:e.changeTo}}],!0);f[0].done(function(b){d.removeClass(l.EDITING+e.old).addClass(l.EDITING+e.changeTo);d.attr("href",d.attr("href").replace("&"+e.old+"=","&"+e.changeTo+"="));var c=d.find(k.MENU_ACTION),f=d.closest(k.SUBTILE);if(e.changeTo===l.SHOW){c.html(c.html().replace(h.show,h.hide));d.find("i").removeClass(l.FA_EYE_SLASH).addClass(l.FA_EYE);f.removeClass(l.DIMMED)}else if(e.changeTo===l.HIDE){c.html(c.html().replace(h.hide,h.show));d.find("i").removeClass(l.FA_EYE).addClass(l.FA_EYE_SLASH);f.addClass(l.DIMMED)}var g=a(b).find(k.AVAIL_INFO),i=f.find(k.AVAIL_INFO);if(g){if(i.length){i.replaceWith(g)}else{g.appendTo(f.find(k.ACTIVITY_INSTANCE))}}else{i.hide()}});f[0].fail(function(){window.location.replace(d.attr("href"))})}},o=function(a){return{powerpoint:"ppt",document:"doc",spreadsheet:"xls",archive:"zip",pdf:"pdf",mp3:"mp3",mpeg:"mp4",jpeg:"jpeg",text:"txt",html:"html"}[a.split("/").slice(-1)[0].split("-")[0]]},p=function(b,c,d){if(d===void 0||""===d){d=h.other}b.find("a.cm-edit-action").each(function(b,c){a(c).attr("data-action","")});b.find("a.editing_moveright").remove();var e={cmid:b.attr("id").split("-").slice(-1)[0],modtitle:b.find(k.INSTANCE_NAME).html().split("<")[0],cmeditmenu:b.find(k.SECTION_CM_EDIT_ACTIONS)[0].outerHTML.replace(/\n/g,""),cmmove:b.find(k.EDITING_MOVE)[0].outerHTML,modname:"resource",modResourceType:c,modnameDisplay:d,useSubtiles:1,isEmbeddedResource:0,clickable:1,isediting:1,visible:1};e.isPdf="pdf"===e.modResourceType;return e},q=function(b,d,j,n){if(j.hasClass(l.SECTION_DRAGGABLE)&&-1===window.location.href.indexOf("expand=")){window.location=g.wwwroot+"/course/view.php?id="+b+"&expand="+j.attr("data-section")+"#section-"+j.attr("data-section")}else if(d.hasClass(l.LABEL)&&d.closest("ul").hasClass("subtiles")){window.location.reload()}else if(d.hasClass(l.ACTIVITY)&&d.closest("ul").hasClass("subtiles")){d.children().hide();d.append(a("<img/>").attr("src",f.imageUrl("loading","format_tiles")).addClass("loading-subtile").attr("title",h.loading));var q=d.prevAll(k.SUBTILE).not(k.SPACER).first();d.prevUntil(q,k.SPACER).hide();var r=o(d.find(k.ACTIVITY_ICON).attr("src"));if(r===void 0){window.location.reload()}var s="displaytitle_mod_"+r;if(h[s]===void 0){e.get_string(s,"format_tiles").done(function(b){if("[["!==b.substring(0,2)){h[s]=b}else{b=""}var e=p(d,r,b);c.render("format_tiles/course_module",e).done(function(b){d.replaceWith(b);var c=a("#"+a(n).attr("id"));i.animate({scrollTop:c.offset().top-130},"fast");for(var f=0;3>f;f++){c.fadeOut(300).fadeIn(300)}a("#module-"+e.cmid).find(".editing_move").attr("data-action","").on(m.MOUSEDOWN,function(){window.location.reload()})})})}else{var t=p(d,r,h[s]);c.render("format_tiles/course_module",t).done(function(b){d.replaceWith(b);a("#module-"+t.cmid).find(".editing_move").attr("data-action","").on(m.MOUSEDOWN,function(){window.location.reload()})})}}else{d.find("div.mod-indent-outer").css("position","absolute").css("top","0").css("width","100%").css("padding-left","0")}};return{init:function init(b,c,f){a(document).ready(function(){Y.use("moodle-course-coursebase",function(){if("undefined"!=typeof M.course){setTimeout(function(){M.course.coursebase.registermodules=[]},500)}});a(k.LABEL_CONVERT).on(m.CLICK,function(b){b.preventDefault();d.confirm(h.areyousure,h.converttopage_confirm,h.yes,h.no,function(){window.location=a(b.currentTarget).attr("href")},null)});if(0!==f){var c=a("#module-"+f);i.animate({scrollTop:c.offset().top-130},"fast");for(var g=0;3>g;g++){c.fadeOut(300).fadeIn(300)}}j.on("click",k.CM_EDIT_ACTION,function(a){n(a)});a(document).on(m.MODULE_ADDED,function(c,d){var e=a("#"+a(d).attr("id")),f=e.closest(k.SECTION_MAIN);if(1<=f.length){q(b,e,f,d)}});j.on(m.CLICK,k.EDITING_DELETE,function(b){var c=a(b.currentTarget).closest("li"+l.ACTIVITY),d=c.prevAll(k.SUBTILE).not(k.SPACER).first();if(c.hasClass(l.LABEL)){c.prevUntil(d,k.SPACER).hide()}});e.get_strings([{key:"yes"},{key:"no"},{key:"show"},{key:"hide"},{key:"converttopage_confirm",component:"format_tiles"},{key:"areyousure"},{key:"complete",component:"format_tiles"},{key:"fileaddedtobottom",component:"format_tiles"},{key:"loading",component:"format_tiles"}]).done(function(a){h={yes:a[0],no:a[1],show:a[2],hide:a[3],converttopage_confirm:a[4],areyousure:a[5],complete:a[6],fileaddedtobottom:a[7],loading:a[8]}})})}}});
//# sourceMappingURL=edit_course_mod.min.js.map