Sindbad~EG File Manager
define(["jquery"],function(e){var n={ACTIVITY_TOGGLE:".showactivity",ACTIVITY_TOGGLE_CLASS:"showhideactivity",ACTIVITY_TOGGLE_WRAPPER:".showactivitywrapper",FIRST_SECTION:"#section-0",SHOW:"show",TOGGLE_HIGHLIGHT:".section_action_menu .dropdown-item.editing_highlight",TOGGLE_SHOWHIDE:".section_action_menu .dropdown-item.editing_showhide",DELETE:".section_action_menu .dropdown-item.editing_delete",BUTTON_HIDE:".cm_action_menu .dropdown-menu .editing_hide",BUTTON_SHOW:".cm_action_menu .dropdown-menu .editing_show",ACTIVITYBUTTON_HIDE:'.cm_action_menu .dropdown-menu [data-action="cmHide"]',ACTIVITYBUTTON_SHOW:'.cm_action_menu .dropdown-menu [data-action="cmShow"]',ACTIVITYDUPLICATE:".cm_action_menu .dropdown-item.editing_duplicate",ACTIVITIYDELETE:".cm_action_menu .dropdown-item.editing_delete"};function t(){e(n.FIRST_SECTION+" ul.general-section-activities li").length<=function(){let n=e(window).width();return e(".remui-format-list").length?n>=992?4:n>=768?3:2:n>=768?4:n>=481?2:1}()?(e(n.FIRST_SECTION).removeClass(n.ACTIVITY_TOGGLE_CLASS),e(n.ACTIVITY_TOGGLE_WRAPPER).hide()):(e(n.ACTIVITY_TOGGLE_WRAPPER).show(),e(n.FIRST_SECTION).addClass(n.ACTIVITY_TOGGLE_CLASS))}return{init:function(){e("#page-course-view-remuiformat .section-modchooser-link:not(.dropdown-item)").addClass("btn btn-primary"),t(),e(n.ACTIVITY_TOGGLE).on("click",function(){e(this).hasClass(n.SHOW)?(e(this).html(M.util.get_string("showless","format_remuiformat")),e(this).toggleClass(n.SHOW)):(e(this).html(M.util.get_string("showmore","format_remuiformat")),e(this).toggleClass(n.SHOW),e("html, body").animate({scrollTop:e(n.FIRST_SECTION+" ul.general-section-activities li:first-child").offset().top-66},"slow")),e(n.FIRST_SECTION).toggleClass(n.ACTIVITY_TOGGLE_CLASS)}),e("body").on("click",`${n.TOGGLE_HIGHLIGHT},\n ${n.TOGGLE_SHOWHIDE},\n ${n.BUTTON_HIDE},\n ${n.BUTTON_SHOW},\n ${n.ACTIVITYBUTTON_HIDE},\n ${n.ACTIVITYBUTTON_SHOW}`,function(){setTimeout(function(){location.reload()},400)}),e("body").on("click",`${n.ACTIVITYDUPLICATE}`,function(){setTimeout(function(){location.reload()},200)}),e("body").on("click",`${n.ACTIVITIYDELETE},${n.DELETE}`,function(n){return n.preventDefault(),"cmDelete"==e(this).attr("data-action")&&(window.location.href=e(this).attr("href")),"deleteSection"==e(this).attr("data-action")&&(moodleversionbranch>="405"?location.reload():window.location.href=e(this).attr("href")),!0}),e("body").on("click",'[data-action="addModule"]',function(e){return setTimeout(()=>{location.reload()},200),!0}),e(".read-more-target").height()>300&&(e(".generalsectioninfo").find("#readmorebtn").removeClass("d-none"),e(".read-more-target").addClass("summary-collapsed").removeClass("summary-expanded")),e("#readmorebtn").on("click",function(){e(".read-more-target").addClass("summary-expanded").removeClass("summary-collapsed"),e(".generalsectioninfo").find("#readmorebtn").addClass("d-none"),e(".generalsectioninfo").find("#readlessbtn").removeClass("d-none")}),e("#readlessbtn").on("click",function(){e(".read-more-target").addClass("summary-collapsed").removeClass("summary-expanded"),e(".generalsectioninfo").find("#readmorebtn").removeClass("d-none"),e(".generalsectioninfo").find("#readlessbtn").addClass("d-none")})},adjustGeneralSectionActivities:t}});
//# sourceMappingURL=common.min.js.map
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists