From 540f6f31d513e0ecab70fc23daa9dead89670ba9 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 16 Nov 2023 13:37:59 -0700 Subject: [PATCH] hotfix - minor fixes for snap.js --- theme/snap/amd/build/snap.min.js | 2 +- theme/snap/amd/build/snap.min.js.map | 2 +- theme/snap/amd/src/snap.js | 12 +++++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/theme/snap/amd/build/snap.min.js b/theme/snap/amd/build/snap.min.js index e5ede0082800e..85dc945e51777 100644 --- a/theme/snap/amd/build/snap.min.js +++ b/theme/snap/amd/build/snap.min.js @@ -18,6 +18,6 @@ * @copyright Copyright (c) 2015 Open LMS (https://www.openlms.net) * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -define("theme_snap/snap",["jquery","core/log","theme_snap/headroom","theme_snap/util","theme_snap/personal_menu","theme_snap/cover_image","theme_snap/progressbar","core/templates","core/str","theme_snap/accessibility","theme_snap/messages","theme_snap/scroll"],(function($,log,Headroom,util,personalMenu,coverImage,ProgressBar,templates,str,accessibility,messages,Scroll){M.theme_snap=M.theme_snap||{};log.disableAll(!0);var brandColorSuccess="",brandColorWarning="",GRADE_DISPLAY_TYPE_PERCENTAGE="",GRADE_DISPLAY_TYPE_PERCENTAGE_REAL="",GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER="",GRADE_DISPLAY_TYPE_REAL="",GRADE_DISPLAY_TYPE_REAL_PERCENTAGE="",GRADE_DISPLAY_TYPE_REAL_LETTER="",getURLParams=function(href){var ta=href.split("?");if(ta.length<2)return!1;for(var urlparams=ta[1],items=(urlparams=urlparams.split("#")[0]).split("&"),params=[],i=0;i div.form-group.fitem"),savebuttonsformadvanced=$("div[role=main] .mform div.snap-form-advanced > div:nth-of-type(3)"),width=$(window).width();width<992?$(".snap-form-advanced").append(savebuttonsformrequired):width>992&&$(".snap-form-required fieldset#id_general").append(savebuttonsformadvanced)};const updateGraderHeadersTop=function(){const graderHeader=$(".path-grade-report-grader .gradeparent tr.heading");graderHeader.length&&graderHeader.css("top",$("#mr-nav").height()+"px")},regionMain=$('.path-grade-report-grader #region-main div[role="main"]');if(regionMain.length>0){regionMain[0].querySelector(".gradeparent")&®ionMain.addClass("snap-grade-reporter")}updateGraderHeadersTop();var onCoursePage=function(){return 0===$("body").attr("id").indexOf("page-course-view-")},processSearchString=function(searchString){return searchString=searchString.trim().toLowerCase()},createColoredDataCircle=function(nodePointer,dataCallback){let valueCallback=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var circle=new ProgressBar.Circle(nodePointer,{color:"inherit",easing:"linear",strokeWidth:6,trailWidth:3,duration:1400,text:{value:"0"}}),value=$(nodePointer).attr("value")/100,endColor=brandColorSuccess;0===value||"-"===$(nodePointer).attr("value")?circle.setText("-"):($(nodePointer).attr("value")<50&&(endColor=brandColorWarning),circle.setText(dataCallback(nodePointer)));var valueAnimate=0;valueAnimate=null===valueCallback?value:valueCallback(nodePointer),circle.animate(valueAnimate,{from:{color:"#999"},to:{color:endColor},step:function(state,circle){circle.path.setAttribute("stroke",state.color)}})},addListeners=function(){$(document).on("click",[".chapters a",".section_footer a"," #toc-search-results a"].join(", "),(function(e){var href=this.getAttribute("href");window.history&&window.history.pushState?(history.pushState(null,null,href),$(window).trigger("hashchange"),e.preventDefault()):location.hash=href}));var myElement=document.querySelector("#mr-nav"),headroom=new Headroom(myElement,{tolerance:5,offset:100,classes:{initial:"headroom",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top"},onPin:()=>{$(".snap-drawer-no-headroom").addClass("snap-drawer-headroom"),$(".snap-drawer-headroom").removeClass("snap-drawer-no-headroom")},onUnpin:()=>{$(".snap-drawer-headroom").addClass("snap-drawer-no-headroom"),$(".snap-drawer-no-headroom").removeClass("snap-drawer-headroom")}});$(".notloggedin").length||headroom.init();var dataList=$("#toc-searchables").find("li").clone(!0);$("#course-toc").on("keyup","#toc-search-input",(function(){!function(dataList){var i,ua=window.navigator.userAgent;(ua.indexOf("MSIE ")||ua.indexOf("Trident/"))&&(dataList=$("#toc-searchables").find("li").clone(!0));var searchString=$("#toc-search-input").val();if(0===(searchString=processSearchString(searchString)).length)$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active");else{$("#toc-search-input").addClass("state-active");var matches=[];for(i=0;i-1&&matches.push(dataItem)}$("#toc-search-results").html(matches)}}(dataList)})),$("#course-toc").on("keydown","#toc-search-input",(function(e){9===(e.keyCode||e.which)&&$("#toc-search-results a").last().blur((function(){$(this).off("blur"),$("#toc-search-input").val(""),$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active")}))})),$("#course-toc").on("click","#toc-search-results a",(function(){$("#toc-search-input").val(""),$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active")})),$(document).on("click",(function(event){$(event.target).closest("#toc-search-input").length||($("#toc-search-input").val(""),$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active"))})),$(document).on("click","#admin-menu-trigger, #toc-mobile-menu-toggle",(function(e){var href=this.getAttribute("href");"admin-menu-trigger"===this.getAttribute("id")&&($(this).toggleClass("active"),$("#page").toggleClass("offcanvas")),$(href).attr("tabindex","0"),$(href).toggleClass("state-visible").focus(),e.preventDefault(),0===$(".message-app.main").length&&document.dispatchEvent(new Event("messages-drawer:toggle"))})),$(document).on("click","#course-toc.state-visible a",(function(){$("#course-toc").removeClass("state-visible")})),$(document).on("click",".section_footer a, .chapter-title, .toc-footer a",(function(){const videos=$('[title="watch"], .video-js, iframe:not([id])');for(let i=0;i div > a[role="button"]');util.scrollToElement($news),$(".news-article").not($news).removeClass("state-expanded"),$(".news-article .toggle").not($newstoggle).attr("aria-expanded","false"),$('.news-article-message > div > a[role="button"]').not($newsclose).attr("aria-expanded","false"),$(".news-article-message").css("display","none"),$news.toggleClass("state-expanded"),$news.attr("state-expanded")||($news.focus(),$newstoggle.attr("aria-expanded","false"),$newsclose.attr("aria-expanded","false")),$(".state-expanded").find(".news-article-message").slideDown("fast",(function(){$news.is(".state-expanded")?($news.find(".news-article-message").focus(),$newstoggle.attr("aria-expanded","true"),$newsclose.attr("aria-expanded","true")):($news.focus(),$newstoggle.attr("aria-expanded","false"),$newsclose.attr("aria-expanded","false")),$(document).trigger("snapContentRevealed")})),e.preventDefault()})),$(document).on("click",".anim-play-button",(function(){$(this).parent().prev().css("visibility","visible")})),$(document).on("click",".anim-pause-button",(function(){$(this).parent().prev().css("visibility","hidden")})),(new Scroll).init(),$((function(){var supportsTouch=!1;if(("ontouchstart"in window||window.navigator.msPointerEnabled)&&(supportsTouch=!0),!supportsTouch){var tooltipNode=$('[data-toggle="tooltip"]');$.isFunction(tooltipNode.tooltip)&&tooltipNode.tooltip()}}))};return{snapInit:function(courseConfig,pageHasCourseContent,siteMaxBytes,forcePassChange,messageBadgeCountEnabled,userId,sitePolicyAcceptReqd,inAlternativeRole,brandColors,gradingConstants){brandColorSuccess=brandColors.success,brandColorWarning=brandColors.warning,GRADE_DISPLAY_TYPE_PERCENTAGE=gradingConstants.gradepercentage,GRADE_DISPLAY_TYPE_PERCENTAGE_REAL=gradingConstants.gradepercentagereal,GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER=gradingConstants.gradepercentageletter,GRADE_DISPLAY_TYPE_REAL=gradingConstants.gradereal,GRADE_DISPLAY_TYPE_REAL_PERCENTAGE=gradingConstants.graderealpercentage,GRADE_DISPLAY_TYPE_REAL_LETTER=gradingConstants.graderealletter,M.cfg.context=courseConfig.contextid,M.snapTheme={forcePassChange:forcePassChange},personalMenu.init(sitePolicyAcceptReqd),pageHasCourseContent&&require(["theme_snap/course-lazy"],(function(CourseLibAmd){!function(courseLib){var lastHash=location.hash;$(window).on("popstate hashchange",(function(e){var newHash=location.hash;log.info("hashchange"),newHash!==lastHash&&("#primary-nav"===location.hash?personalMenu.update():($("#page, #moodle-footer, #js-snap-pm-trigger, #logo, .skiplinks").css("display",""),onCoursePage()&&(log.info("show section",e.target),courseLib.showSection()))),lastHash=newHash}))}(new CourseLibAmd(courseConfig))})),$(document).ready((function(){var extraclasses;!function(){var xdebugs=$(".xdebug-error");if(xdebugs.length)for(var x=0;x

'+M.util.get_string("debugerrors","theme_snap")+"


");$("#page-footer").append(errorcont),$("#footer-error-cont").append(msgs),$(".php-debug-footer").after($("
")),$("#mr-nav").addClass("errors-found");var errorlink=$(''+M.util.get_string("problemsfound","theme_snap")+' '+msgs.length+"");$("#page-header").append(errorlink)}}(),$(".path-mod-forum tr.discussion td.topic.starter").attr("data-cellname",M.util.get_string("forumtopic","theme_snap")),$(".path-mod-forum tr.discussion td.picture:not('.group')").attr("data-cellname",M.util.get_string("forumauthor","theme_snap")),$(".path-mod-forum tr.discussion td.picture.group").attr("data-cellname",M.util.get_string("forumpicturegroup","theme_snap")),$(".path-mod-forum tr.discussion td.replies").attr("data-cellname",M.util.get_string("forumreplies","theme_snap")),$(".path-mod-forum tr.discussion td.lastpost").attr("data-cellname",M.util.get_string("forumlastpost","theme_snap")),addListeners(),function(){if(onCoursePage()&&$(".block_adminblock form").each((function(){$(this).attr("action",$(this).attr("action")+"#coursetools")})),""===location.hash){var urlParams=getURLParams(location.href);onCoursePage()&&void 0!==urlParams.time&&(location.hash="coursetools",$(".block_calendar_month")&&util.scrollToElement($(".block_calendar_month")));var formselectors=["body.path-blocks-collect #notice form"],paramchecks=["bui_deleteid","bui_editid"];for(var p in paramchecks)if(void 0!==urlParams[paramchecks[p]]){formselectors.push("#notice form");break}$(formselectors.join(", ")).each((function(){var formurl=$(this).attr("action");-1===formurl.indexOf("#")&&formurl.indexOf("/course/view.php")>-1&&$(this).attr("action",$(this).attr("action")+"#coursetools")}))}}(),extraclasses=[],$("#notice.snap-continue-cancel").length&&extraclasses.push("hascontinuecancel"),$("body").addClass(extraclasses.join(" ")),mobileFormChecker(),util.processAnimatedImages(),$("#page-mod-assign-view #page-content").append($("#moodle-blocks")),$(".snap-resource-long .contentafterlink .snap-resource-card-fadeout").each((function(){$(this).appendTo($(this).prevAll(".snap-resource-long .contentafterlink .no-overflow"))})),$(".snap-header-card .snap-header-card-icons .disabled-snap-asset-completion-tracking").remove();var folders=$("li.snap-activity.modtype_folder");if($.each(folders,(function(index,folder){var content=$(folder).find("div.contentwithoutlink div.snap-assettype");if(content.length>0&&0==$(folder).find("div.activityinstance div.snap-header-card .asset-type").length){var folderAssetTypeHeader=$(folder).find("div.activityinstance div.snap-header-card");content.prependTo(folderAssetTypeHeader)}})),$("body").addClass("snap-js-loaded"),$(".snap-student-dashboard-progress .js-progressbar-circle").each((function(){createColoredDataCircle(this,(function(nodePointer){return $(nodePointer).attr("value")+"%"}))})),$(".snap-student-dashboard-grade .js-progressbar-circle").each((function(){createColoredDataCircle(this,(function(nodePointer){var nodeValue=$(nodePointer).attr("value"),gradeFormat=$(nodePointer).attr("gradeformat");return gradeFormat!=GRADE_DISPLAY_TYPE_PERCENTAGE&&gradeFormat!=GRADE_DISPLAY_TYPE_PERCENTAGE_REAL&&gradeFormat!=GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER||(nodeValue+="%"),nodeValue}),(function(nodePointer){$(nodePointer).attr("value");var gradeFormat=$(nodePointer).attr("gradeformat");return gradeFormat==GRADE_DISPLAY_TYPE_REAL||gradeFormat==GRADE_DISPLAY_TYPE_REAL_PERCENTAGE||gradeFormat==GRADE_DISPLAY_TYPE_REAL_LETTER?0:$(nodePointer).attr("value")/100}))})),$("#snap-course-footer-recent-activity .info").each((function(){$(this).appendTo($(this).prev())})),$("#snap-course-footer-recent-activity .head .name").each((function(){$(this).prependTo($(this).closest(".head"))})),$("body").hasClass("pagelayout-course")||$("body").hasClass("pagelayout-frontpage")?coverImage.courseImage(courseConfig.shortname,siteMaxBytes):$("body").hasClass("pagelayout-coursecategory")&&courseConfig.categoryid&&coverImage.categoryImage(courseConfig.categoryid,siteMaxBytes),$("#page-admin-setting-themesettingsnap").length){var tabHash=location.hash;tabHash&&$('.nav-link[href="'+tabHash+'"]').length&&($('.nav-link[href="'+tabHash+'"]').tab("show"),$(window).scrollTop(0));var changeNodeVisibilityOnChecked=function(selectorToCheck,selectorToChange){var nodeToCheck=$(selectorToCheck),nodeToChange=$(selectorToChange);nodeToCheck.is(":checked")?nodeToChange.show():nodeToChange.hide()},advFeedsCheckboxSelector="#id_s_theme_snap_personalmenuadvancedfeedsenable";changeNodeVisibilityOnChecked(advFeedsCheckboxSelector,"#admin-personalmenuadvancedfeedslifetime"),$(advFeedsCheckboxSelector).on("click",(function(){changeNodeVisibilityOnChecked(advFeedsCheckboxSelector,"#admin-personalmenuadvancedfeedslifetime")}))}var firstlinkerror=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_one_title_link span.error"),secondlinkerror=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_two_title_link span.error"),thirdlinkerror=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_three_title_link span.error"),titlelinksettingone=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_one_title_link .form-label"),titlelinksettingtwo=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_two_title_link .form-label"),titlelinksettingthree=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_three_title_link .form-label");$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_three_title").nextUntil("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_one_title_link_cb").wrapAll("");var linktitlestyle={"padding-bottom":"2.1em"};if(firstlinkerror.length&&(titlelinksettingtwo.css(linktitlestyle),titlelinksettingthree.css(linktitlestyle)),secondlinkerror.length&&(titlelinksettingone.css(linktitlestyle),titlelinksettingthree.css(linktitlestyle)),thirdlinkerror.length&&(titlelinksettingone.css(linktitlestyle),titlelinksettingtwo.css(linktitlestyle)),$("body").hasClass("snap-pm-open")&&personalMenu.update(),$("#page-course-editsection.format-topics").length){var usedefaultname=document.getElementById("id_name_customize"),sname=document.getElementById("id_name_value");usedefaultname.value="1",usedefaultname.checked=!0,sname.required="required",$(sname).attr("pattern",".*\\S+.*"),$(usedefaultname).parent().css("display","none"),$("#id_cancel").on("click",(function(){return $(sname).removeAttr("required"),$(sname).removeAttr("pattern"),!0}))}else $("#id_name_value").attr("pattern",".*\\S+.*"),$("#id_cancel").on("click",(function(){return $(sname).removeAttr("pattern"),!0}));if($('#page-mod-book-view a[href*="mod/book/tool/print/index.php"]').length){var urlParams=getURLParams(location.href);urlParams&&$('[data-block="_fake"]').append('


'+M.util.get_string("printbook","booktool_print")+"

")}var modSettingsIdRe=/^page-mod-.*-mod$/,onModSettings=modSettingsIdRe.test($("body").attr("id"))&&location.href.indexOf("modedit")>-1;onModSettings||(onModSettings=(modSettingsIdRe=/^page-mod-.*-general$/).test($("body").attr("id"))&&location.href.indexOf("modedit")>-1);var onCourseSettings="page-course-edit"===$("body").attr("id"),onSectionSettings="page-course-editsection"===$("body").attr("id");$("#page-mod-hvp-mod .h5p-editor-iframe").parent().css({display:"block"});var pageNotInBlacklist=-1===["page-mod-hvp-mod"].indexOf($("body").attr("id"));if((onModSettings||onCourseSettings||onSectionSettings)&&pageNotInBlacklist){var vital=[":first","#page-course-edit #id_descriptionhdr","#id_contentsection","#id_general + #id_general","#id_content","#page-mod-choice-mod #id_optionhdr","#page-mod-workshop-mod #id_gradingsettings","#page-mod-choicegroup-mod #id_miscellaneoussettingshdr","#page-mod-choicegroup-mod #id_groups","#page-mod-scorm-mod #id_packagehdr"];vital=vital.join(),$('form[id^="mform1"] > fieldset').not(vital).wrapAll('
'),$(".snap-form-advanced").append($(".collapsible-actions")),$("#page-course-edit").length||$(".snap-form-advanced fieldset").addClass("collapsed");for(var mainForm=$('form[id^="mform1"] fieldset:first'),appendTo=$('form[id^="mform1"] fieldset:first .fcontainer'),required=$('form[id^="mform1"] > fieldset').not('form[id^="mform1"] > fieldset:first'),i=0;i'),$("body#page-mod-lti-mod").length){var multipleLTIActivities=document.querySelector('section#region-main form.mform > div[data-attribute="dynamic-import"]');new MutationObserver((function(){$("fieldset#id_general > :nth-child(5)").detach().appendTo('section#region-main > div[role="main"] > form.mform')})).observe(multipleLTIActivities,{childList:!0})}var description=$('form[id^="mform1"] fieldset:first .fitem_feditor:not(.required)');if(onModSettings&&description){0===$(["body#page-mod-assign-mod","body#page-mod-choice-mod","body#page-mod-turnitintool-mod","body#page-mod-workshop-mod"].join()).length&&($(appendTo).append(description),$(appendTo).append($("#fitem_id_showdescription"))),$(["body#page-mod-url-mod","body#page-mod-resource-mod","body#page-mod-folder-mod","body#page-mod-imscp-mod","body#page-mod-lightboxgallery-mod","body#page-mod-scorm-mod"].join()).length>0&&str.get_strings([{key:"multimediacard",component:"theme_snap"}]).done((function(stringsjs){var activityCards=stringsjs[0],cardmultimedia=$("[id='id_showdescription']").closest(".form-group");$(cardmultimedia).append(activityCards)}))}description=$("#page-mod-resource-mod [data-fieldtype='editor']").closest(".form-group");var showdescription=$("#page-mod-resource-mod [id='id_showdescription']").closest(".form-group");$("#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer").append(description),$("#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer").append(showdescription);var duedate=$("#page-mod-assign-mod [for='id_duedate']").closest(".form-group");$("#page-mod-assign-mod .snap-form-required .fcontainer").append(duedate);var availablity=$("#id_visible").closest(".form-group").addClass("snap-form-visibility"),label=$(availablity).find("label"),select=$(availablity).find("select");if($(label).insertBefore(select),$(label).text(M.util.get_string("visibility","theme_snap")+" "),$("#page-course-edit").length){var strDisabled="";str.get_strings([{key:"showallsectionsdisabled",component:"theme_snap"},{key:"disabled",component:"theme_snap"}]).then((function(strings){var strMessage=strings[0];return strDisabled=strings[1],templates.render("theme_snap/form_alert",{type:"warning",classes:"",message:strMessage})})).then((function(html){var op0=$('[name="coursedisplay"] > option[value="0"]'),op1=$('[name="coursedisplay"] > option[value="1"]'),selectNode=$('[name="coursedisplay"]');op0.attr("disabled","disabled"),op0.append(" ("+strDisabled+")"),op0.removeAttr("selected"),op1.attr("selected","selected"),selectNode.parent().append(html)}))}$(".snap-form-advanced").prepend(availablity);var savebuttons=$('form[id^="mform1"] > .form-group:last');$(mainForm).append(savebuttons);var errorElements=$(".form-group.has-danger");onModSettings&&errorElements.length&&errorElements.closest(".collapsible").removeClass("collapsed"),$("#page-mod-page-mod").length&&(str.get_strings([{key:"showappearancedisabled",component:"theme_snap"}]).then((function(localizedstring){return templates.render("theme_snap/form_alert",{type:"warning",classes:"",message:localizedstring})})).then((function(html){var pageInputs=$('[id="id_printheading"], [id="id_printintro"], [id="id_printlastmodified"], [id="id_display"], [id="id_popupwidth"], [id="id_popupheight"]');$("#id_display option:not(:selected)").attr("disabled",!0),pageInputs.attr("readonly",!0),$("#id_display").attr("disabled",!0),pageInputs.attr("tabindex",-1),pageInputs.click((function(e){return e.preventDefault(),!1})),pageInputs.parent().parent().parent().css("background-color","#f1f1f1"),pageInputs.parent().parent().parent().css("color","#d5d5d5"),$("#id_appearancehdrcontainer").append(html)})),$("#id_showdescription").parent().parent().parent().hide())}if(onSectionSettings&&$("#page-course-editsection.format-topics .form-group #id_name_value").length){document.getElementById("id_name_value").hasAttribute("disabled")&&document.getElementById("id_name_value").removeAttribute("disabled")}messageBadgeCountEnabled&&require(["theme_snap/conversation_badge_count-lazy"],(function(conversationBadgeCount){conversationBadgeCount.init(userId)})),$(".message-app .list-group").on("click",".list-group-item.list-group-item-action",(function(e){require(["theme_snap/conversation_badge_count-lazy"],(function(conversationBadgeCount){let conversationId=e.currentTarget.attributes["data-conversation-id"].value;conversationBadgeCount.init(userId,conversationId)}))}));var focustarget=$("#snap-coverimagecontrol label");focustarget&&focustarget.length&&focustarget.keypress((function(e){13===e.which&&$("#snap-coverfiles").trigger("click")})),$(".block_settings").length||($("#admin-menu-trigger").hide(),inAlternativeRole&&require(["theme_snap/alternative_role_handler-lazy"],(function(alternativeRoleHandler){alternativeRoleHandler.init(courseConfig.id)})));var lastElement,customMenu=$("ul.snap-navbar-content li:first-child a"),moodlePage=$("#moodle-page a:first"),notificationsBtn=$("#nav-notification-popover-container > div.popover-region-toggle.nav-link"),searchButton=$("#mr-nav .simplesearchform a.btn.btn-open"),adminMenuTrigger=$("#admin-menu-trigger");lastElement=customMenu.length?customMenu:moodlePage,notificationsBtn.length&&searchButton.length&&adminMenuTrigger.length&&lastElement.length&&require(["theme_snap/rearrange_tab_handler-lazy"],(function(searchTabHandler){searchTabHandler.init([notificationsBtn,searchButton,adminMenuTrigger,lastElement])})),$(".snap-settings-tab-link").on("click",(function(){var tab=$('a[href="'+$(this).attr("href")+'"].nav-link');tab.length&&tab.tab("show")})),"#course-detail-title"===window.location.hash&&$("#mr-nav").removeClass("headroom--pinned").addClass("headroom--unpinned");var savebuttonsformrequired=$("div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem");if($(window).width()<767&&$(".snap-form-advanced").append(savebuttonsformrequired),$(".path-mod.theme-snap #id_coursecontentnotification").length){const notificationCheck=document.getElementById("id_coursecontentnotification").closest(".form-group.fitem"),submitButtons=$('.snap-form-required [data-groupname="buttonar"]');null!==notificationCheck&&submitButtons.length&&(notificationCheck.classList.add("snap_content_notification_check"),submitButtons.before(notificationCheck))}if($("#page-home.theme-snap .intelliboard-page").length&&$(".snap-page-heading-button").length){document.getElementsByClassName("snap-page-heading-button")[0].classList.add("hidden")}const editingButton=$("#page-grade-report-singleview-index .grade_report_edit_button");editingButton.length&&!$(".search-widget.dropdown").length&&editingButton.addClass("hidden");var targetTilesSect=document.querySelector("section#tiles-section");new MutationObserver((function(){util.processAnimatedImages()})).observe(targetTilesSect,{childList:!0,subtree:!0}),function(){var i=0,checker=setInterval((function(){(i+=1)>15?clearInterval(checker):0!=$("button.atto_fullscreen_button").length&&0!=$("div.editor_atto").length&&($("button.atto_fullscreen_button").click((function(){$("div.editor_atto").css("background-color","#eee"),$("div.editor_atto").css("z-index","1")})),$("button.atto_html_button").click((function(){$("#id_introeditor").css("z-index","1")})),clearInterval(checker))}),2e3)}()})),accessibility.snapAxInit(),messages.init(),$("div#goto-top-link > a").click((function(){window.scrollTo({top:0,behavior:"smooth"}),$("body").find("a, [tabindex=0]").first().focus()}));var noneditingblocks={blockxp:"#page-blocks-xp-index"};for(var block in noneditingblocks){!0===$(noneditingblocks[block]).hasClass("editing")&&$(noneditingblocks[block]).removeClass("editing")}$(".togglecompletion").on("submit",(function(){!0===$(".togglecompletion").hasClass("forcereload")&&setTimeout((function(){location.reload(!0)}),1500)})),document.body.classList.contains("snap-resource-card")||document.querySelectorAll(".activityiconcontainer.url").forEach((urlDiv=>{urlDiv.querySelector('img[src*="/theme/image.php/snap/core/"][src*="/f/"]')&&(urlDiv.style.backgroundColor="inherit")}))}}})); +define("theme_snap/snap",["jquery","core/log","theme_snap/headroom","theme_snap/util","theme_snap/personal_menu","theme_snap/cover_image","theme_snap/progressbar","core/templates","core/str","theme_snap/accessibility","theme_snap/messages","theme_snap/scroll"],(function($,log,Headroom,util,personalMenu,coverImage,ProgressBar,templates,str,accessibility,messages,Scroll){M.theme_snap=M.theme_snap||{};log.disableAll(!0);var brandColorSuccess="",brandColorWarning="",GRADE_DISPLAY_TYPE_PERCENTAGE="",GRADE_DISPLAY_TYPE_PERCENTAGE_REAL="",GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER="",GRADE_DISPLAY_TYPE_REAL="",GRADE_DISPLAY_TYPE_REAL_PERCENTAGE="",GRADE_DISPLAY_TYPE_REAL_LETTER="",getURLParams=function(href){var ta=href.split("?");if(ta.length<2)return!1;for(var urlparams=ta[1],items=(urlparams=urlparams.split("#")[0]).split("&"),params=[],i=0;i div.form-group.fitem"),savebuttonsformadvanced=$("div[role=main] .mform div.snap-form-advanced > div:nth-of-type(3)"),width=$(window).width();width<992?$(".snap-form-advanced").append(savebuttonsformrequired):width>992&&$(".snap-form-required fieldset#id_general").append(savebuttonsformadvanced)};const updateGraderHeadersTop=function(){const graderHeader=$(".path-grade-report-grader .gradeparent tr.heading");graderHeader.length&&graderHeader.css("top",$("#mr-nav").height()+"px")},regionMain=$('.path-grade-report-grader #region-main div[role="main"]');if(regionMain.length>0){regionMain[0].querySelector(".gradeparent")&®ionMain.addClass("snap-grade-reporter")}updateGraderHeadersTop();var onCoursePage=function(){return 0===$("body").attr("id").indexOf("page-course-view-")},processSearchString=function(searchString){return searchString=searchString.trim().toLowerCase()},createColoredDataCircle=function(nodePointer,dataCallback){let valueCallback=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;var circle=new ProgressBar.Circle(nodePointer,{color:"inherit",easing:"linear",strokeWidth:6,trailWidth:3,duration:1400,text:{value:"0"}}),value=$(nodePointer).attr("value")/100,endColor=brandColorSuccess;0===value||"-"===$(nodePointer).attr("value")?circle.setText("-"):($(nodePointer).attr("value")<50&&(endColor=brandColorWarning),circle.setText(dataCallback(nodePointer)));var valueAnimate=0;valueAnimate=null===valueCallback?value:valueCallback(nodePointer),circle.animate(valueAnimate,{from:{color:"#999"},to:{color:endColor},step:function(state,circle){circle.path.setAttribute("stroke",state.color)}})},addListeners=function(){$(document).on("click",[".chapters a",".section_footer a"," #toc-search-results a"].join(", "),(function(e){var href=this.getAttribute("href");window.history&&window.history.pushState?(history.pushState(null,null,href),$(window).trigger("hashchange"),e.preventDefault()):location.hash=href}));var myElement=document.querySelector("#mr-nav"),headroom=new Headroom(myElement,{tolerance:5,offset:100,classes:{initial:"headroom",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top"},onPin:()=>{$(".snap-drawer-no-headroom").addClass("snap-drawer-headroom"),$(".snap-drawer-headroom").removeClass("snap-drawer-no-headroom")},onUnpin:()=>{$(".snap-drawer-headroom").addClass("snap-drawer-no-headroom"),$(".snap-drawer-no-headroom").removeClass("snap-drawer-headroom")}});$(".notloggedin").length||headroom.init();var dataList=$("#toc-searchables").find("li").clone(!0);$("#course-toc").on("keyup","#toc-search-input",(function(){!function(dataList){var i,ua=window.navigator.userAgent;(ua.indexOf("MSIE ")||ua.indexOf("Trident/"))&&(dataList=$("#toc-searchables").find("li").clone(!0));var searchString=$("#toc-search-input").val();if(0===(searchString=processSearchString(searchString)).length)$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active");else{$("#toc-search-input").addClass("state-active");var matches=[];for(i=0;i-1&&matches.push(dataItem)}$("#toc-search-results").html(matches)}}(dataList)})),$("#course-toc").on("keydown","#toc-search-input",(function(e){9===(e.keyCode||e.which)&&$("#toc-search-results a").last().blur((function(){$(this).off("blur"),$("#toc-search-input").val(""),$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active")}))})),$("#course-toc").on("click","#toc-search-results a",(function(){$("#toc-search-input").val(""),$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active")})),$(document).on("click",(function(event){$(event.target).closest("#toc-search-input").length||($("#toc-search-input").val(""),$("#toc-search-results").html(""),$("#toc-search-input").removeClass("state-active"))})),$(document).on("click","#admin-menu-trigger, #toc-mobile-menu-toggle",(function(e){var href=this.getAttribute("href");"admin-menu-trigger"===this.getAttribute("id")&&($(this).toggleClass("active"),$("#page").toggleClass("offcanvas")),$(href).attr("tabindex","0"),$(href).toggleClass("state-visible").focus(),e.preventDefault(),0===$(".message-app.main").length&&document.dispatchEvent(new Event("messages-drawer:toggle"))})),$(document).on("click","#course-toc.state-visible a",(function(){$("#course-toc").removeClass("state-visible")})),$(document).on("click",".section_footer a, .chapter-title, .toc-footer a",(function(){const videos=$('[title="watch"], .video-js, iframe:not([id])');for(let i=0;i div > a[role="button"]');util.scrollToElement($news),$(".news-article").not($news).removeClass("state-expanded"),$(".news-article .toggle").not($newstoggle).attr("aria-expanded","false"),$('.news-article-message > div > a[role="button"]').not($newsclose).attr("aria-expanded","false"),$(".news-article-message").css("display","none"),$news.toggleClass("state-expanded"),$news.attr("state-expanded")||($news.focus(),$newstoggle.attr("aria-expanded","false"),$newsclose.attr("aria-expanded","false")),$(".state-expanded").find(".news-article-message").slideDown("fast",(function(){$news.is(".state-expanded")?($news.find(".news-article-message").focus(),$newstoggle.attr("aria-expanded","true"),$newsclose.attr("aria-expanded","true")):($news.focus(),$newstoggle.attr("aria-expanded","false"),$newsclose.attr("aria-expanded","false")),$(document).trigger("snapContentRevealed")})),e.preventDefault()})),$(document).on("click",".anim-play-button",(function(){$(this).parent().prev().css("visibility","visible")})),$(document).on("click",".anim-pause-button",(function(){$(this).parent().prev().css("visibility","hidden")})),(new Scroll).init(),$((function(){var supportsTouch=!1;if(("ontouchstart"in window||window.navigator.msPointerEnabled)&&(supportsTouch=!0),!supportsTouch){var tooltipNode=$('[data-toggle="tooltip"]');$.isFunction(tooltipNode.tooltip)&&tooltipNode.tooltip()}}))};return{snapInit:function(courseConfig,pageHasCourseContent,siteMaxBytes,forcePassChange,messageBadgeCountEnabled,userId,sitePolicyAcceptReqd,inAlternativeRole,brandColors,gradingConstants){brandColorSuccess=brandColors.success,brandColorWarning=brandColors.warning,GRADE_DISPLAY_TYPE_PERCENTAGE=gradingConstants.gradepercentage,GRADE_DISPLAY_TYPE_PERCENTAGE_REAL=gradingConstants.gradepercentagereal,GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER=gradingConstants.gradepercentageletter,GRADE_DISPLAY_TYPE_REAL=gradingConstants.gradereal,GRADE_DISPLAY_TYPE_REAL_PERCENTAGE=gradingConstants.graderealpercentage,GRADE_DISPLAY_TYPE_REAL_LETTER=gradingConstants.graderealletter,M.cfg.context=courseConfig.contextid,M.snapTheme={forcePassChange:forcePassChange},personalMenu.init(sitePolicyAcceptReqd),pageHasCourseContent&&require(["theme_snap/course-lazy"],(function(CourseLibAmd){!function(courseLib){var lastHash=location.hash;$(window).on("popstate hashchange",(function(e){var newHash=location.hash;log.info("hashchange"),newHash!==lastHash&&("#primary-nav"===location.hash?personalMenu.update():($("#page, #moodle-footer, #js-snap-pm-trigger, #logo, .skiplinks").css("display",""),onCoursePage()&&(log.info("show section",e.target),courseLib.showSection()))),lastHash=newHash}))}(new CourseLibAmd(courseConfig))})),$(document).ready((function(){var extraclasses;!function(){var xdebugs=$(".xdebug-error");if(xdebugs.length)for(var x=0;x

'+M.util.get_string("debugerrors","theme_snap")+"


");$("#page-footer").append(errorcont),$("#footer-error-cont").append(msgs),$(".php-debug-footer").after($("
")),$("#mr-nav").addClass("errors-found");var errorlink=$(''+M.util.get_string("problemsfound","theme_snap")+' '+msgs.length+"");$("#page-header").append(errorlink)}}(),$(".path-mod-forum tr.discussion td.topic.starter").attr("data-cellname",M.util.get_string("forumtopic","theme_snap")),$(".path-mod-forum tr.discussion td.picture:not('.group')").attr("data-cellname",M.util.get_string("forumauthor","theme_snap")),$(".path-mod-forum tr.discussion td.picture.group").attr("data-cellname",M.util.get_string("forumpicturegroup","theme_snap")),$(".path-mod-forum tr.discussion td.replies").attr("data-cellname",M.util.get_string("forumreplies","theme_snap")),$(".path-mod-forum tr.discussion td.lastpost").attr("data-cellname",M.util.get_string("forumlastpost","theme_snap")),addListeners(),function(){if(onCoursePage()&&$(".block_adminblock form").each((function(){$(this).attr("action",$(this).attr("action")+"#coursetools")})),""===location.hash){var urlParams=getURLParams(location.href);onCoursePage()&&void 0!==urlParams.time&&(location.hash="coursetools",$(".block_calendar_month")&&util.scrollToElement($(".block_calendar_month")));var formselectors=["body.path-blocks-collect #notice form"],paramchecks=["bui_deleteid","bui_editid"];for(var p in paramchecks)if(void 0!==urlParams[paramchecks[p]]){formselectors.push("#notice form");break}$(formselectors.join(", ")).each((function(){var formurl=$(this).attr("action");-1===formurl.indexOf("#")&&formurl.indexOf("/course/view.php")>-1&&$(this).attr("action",$(this).attr("action")+"#coursetools")}))}}(),extraclasses=[],$("#notice.snap-continue-cancel").length&&extraclasses.push("hascontinuecancel"),$("body").addClass(extraclasses.join(" ")),mobileFormChecker(),util.processAnimatedImages(),$("#page-mod-assign-view #page-content").append($("#moodle-blocks")),$(".snap-resource-long .contentafterlink .snap-resource-card-fadeout").each((function(){$(this).appendTo($(this).prevAll(".snap-resource-long .contentafterlink .no-overflow"))})),$(".snap-header-card .snap-header-card-icons .disabled-snap-asset-completion-tracking").remove();var folders=$("li.snap-activity.modtype_folder");if($.each(folders,(function(index,folder){var content=$(folder).find("div.contentwithoutlink div.snap-assettype");if(content.length>0&&0==$(folder).find("div.activityinstance div.snap-header-card .asset-type").length){var folderAssetTypeHeader=$(folder).find("div.activityinstance div.snap-header-card");content.prependTo(folderAssetTypeHeader)}})),$("body").addClass("snap-js-loaded"),$(".snap-student-dashboard-progress .js-progressbar-circle").each((function(){createColoredDataCircle(this,(function(nodePointer){return $(nodePointer).attr("value")+"%"}))})),$(".snap-student-dashboard-grade .js-progressbar-circle").each((function(){createColoredDataCircle(this,(function(nodePointer){var nodeValue=$(nodePointer).attr("value"),gradeFormat=$(nodePointer).attr("gradeformat");return gradeFormat!=GRADE_DISPLAY_TYPE_PERCENTAGE&&gradeFormat!=GRADE_DISPLAY_TYPE_PERCENTAGE_REAL&&gradeFormat!=GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER||(nodeValue+="%"),nodeValue}),(function(nodePointer){$(nodePointer).attr("value");var gradeFormat=$(nodePointer).attr("gradeformat");return gradeFormat==GRADE_DISPLAY_TYPE_REAL||gradeFormat==GRADE_DISPLAY_TYPE_REAL_PERCENTAGE||gradeFormat==GRADE_DISPLAY_TYPE_REAL_LETTER?0:$(nodePointer).attr("value")/100}))})),$("#snap-course-footer-recent-activity .info").each((function(){$(this).appendTo($(this).prev())})),$("#snap-course-footer-recent-activity .head .name").each((function(){$(this).prependTo($(this).closest(".head"))})),$("body").hasClass("pagelayout-course")||$("body").hasClass("pagelayout-frontpage")?coverImage.courseImage(courseConfig.shortname,siteMaxBytes):$("body").hasClass("pagelayout-coursecategory")&&courseConfig.categoryid&&coverImage.categoryImage(courseConfig.categoryid,siteMaxBytes),$("#page-admin-setting-themesettingsnap").length){var tabHash=location.hash;tabHash&&$('.nav-link[href="'+tabHash+'"]').length&&($('.nav-link[href="'+tabHash+'"]').tab("show"),$(window).scrollTop(0));var changeNodeVisibilityOnChecked=function(selectorToCheck,selectorToChange){var nodeToCheck=$(selectorToCheck),nodeToChange=$(selectorToChange);nodeToCheck.is(":checked")?nodeToChange.show():nodeToChange.hide()},advFeedsCheckboxSelector="#id_s_theme_snap_personalmenuadvancedfeedsenable";changeNodeVisibilityOnChecked(advFeedsCheckboxSelector,"#admin-personalmenuadvancedfeedslifetime"),$(advFeedsCheckboxSelector).on("click",(function(){changeNodeVisibilityOnChecked(advFeedsCheckboxSelector,"#admin-personalmenuadvancedfeedslifetime")}))}var firstlinkerror=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_one_title_link span.error"),secondlinkerror=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_two_title_link span.error"),thirdlinkerror=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_three_title_link span.error"),titlelinksettingone=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_one_title_link .form-label"),titlelinksettingtwo=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_two_title_link .form-label"),titlelinksettingthree=$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_three_title_link .form-label");$("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_three_title").nextUntil("#page-admin-setting-themesettingsnap #themesnapfeaturespots #admin-fs_one_title_link_cb").wrapAll("");var linktitlestyle={"padding-bottom":"2.1em"};if(firstlinkerror.length&&(titlelinksettingtwo.css(linktitlestyle),titlelinksettingthree.css(linktitlestyle)),secondlinkerror.length&&(titlelinksettingone.css(linktitlestyle),titlelinksettingthree.css(linktitlestyle)),thirdlinkerror.length&&(titlelinksettingone.css(linktitlestyle),titlelinksettingtwo.css(linktitlestyle)),$("body").hasClass("snap-pm-open")&&personalMenu.update(),$("#page-course-editsection.format-topics").length){var usedefaultname=document.getElementById("id_name_customize"),sname=document.getElementById("id_name_value");usedefaultname.value="1",usedefaultname.checked=!0,sname.required="required",$(sname).attr("pattern",".*\\S+.*"),$(usedefaultname).parent().css("display","none"),$("#id_cancel").on("click",(function(){return $(sname).removeAttr("required"),$(sname).removeAttr("pattern"),!0}))}else $("#id_name_value").attr("pattern",".*\\S+.*"),$("#id_cancel").on("click",(function(){return $(sname).removeAttr("pattern"),!0}));if($('#page-mod-book-view a[href*="mod/book/tool/print/index.php"]').length){var urlParams=getURLParams(location.href);urlParams&&$('[data-block="_fake"]').append('


'+M.util.get_string("printbook","booktool_print")+"

")}var modSettingsIdRe=/^page-mod-.*-mod$/,onModSettings=modSettingsIdRe.test($("body").attr("id"))&&location.href.indexOf("modedit")>-1;onModSettings||(onModSettings=(modSettingsIdRe=/^page-mod-.*-general$/).test($("body").attr("id"))&&location.href.indexOf("modedit")>-1);var onCourseSettings="page-course-edit"===$("body").attr("id"),onSectionSettings="page-course-editsection"===$("body").attr("id");$("#page-mod-hvp-mod .h5p-editor-iframe").parent().css({display:"block"});var pageNotInBlacklist=-1===["page-mod-hvp-mod"].indexOf($("body").attr("id"));if((onModSettings||onCourseSettings||onSectionSettings)&&pageNotInBlacklist){var vital=[":first","#page-course-edit #id_descriptionhdr","#id_contentsection","#id_general + #id_general","#id_content","#page-mod-choice-mod #id_optionhdr","#page-mod-workshop-mod #id_gradingsettings","#page-mod-choicegroup-mod #id_miscellaneoussettingshdr","#page-mod-choicegroup-mod #id_groups","#page-mod-scorm-mod #id_packagehdr"];vital=vital.join(),$('form[id^="mform1"] > fieldset').not(vital).wrapAll('
'),$(".snap-form-advanced").append($(".collapsible-actions")),$("#page-course-edit").length||$(".snap-form-advanced fieldset").addClass("collapsed");for(var mainForm=$('form[id^="mform1"] fieldset:first'),appendTo=$('form[id^="mform1"] fieldset:first .fcontainer'),required=$('form[id^="mform1"] > fieldset').not('form[id^="mform1"] > fieldset:first'),i=0;i'),$("body#page-mod-lti-mod").length){var multipleLTIActivities=document.querySelector('section#region-main form.mform > div[data-attribute="dynamic-import"]');new MutationObserver((function(){$("fieldset#id_general > :nth-child(5)").detach().appendTo('section#region-main > div[role="main"] > form.mform')})).observe(multipleLTIActivities,{childList:!0})}var description=$('form[id^="mform1"] fieldset:first .fitem_feditor:not(.required)');if(onModSettings&&description){0===$(["body#page-mod-assign-mod","body#page-mod-choice-mod","body#page-mod-turnitintool-mod","body#page-mod-workshop-mod"].join()).length&&($(appendTo).append(description),$(appendTo).append($("#fitem_id_showdescription"))),$(["body#page-mod-url-mod","body#page-mod-resource-mod","body#page-mod-folder-mod","body#page-mod-imscp-mod","body#page-mod-lightboxgallery-mod","body#page-mod-scorm-mod"].join()).length>0&&str.get_strings([{key:"multimediacard",component:"theme_snap"}]).done((function(stringsjs){var activityCards=stringsjs[0],cardmultimedia=$("[id='id_showdescription']").closest(".form-group");$(cardmultimedia).append(activityCards)}))}description=$("#page-mod-resource-mod [data-fieldtype='editor']").closest(".form-group");var showdescription=$("#page-mod-resource-mod [id='id_showdescription']").closest(".form-group");$("#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer").append(description),$("#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer").append(showdescription);var duedate=$("#page-mod-assign-mod [for='id_duedate']").closest(".form-group");$("#page-mod-assign-mod .snap-form-required .fcontainer").append(duedate);var availablity=$("#id_visible").closest(".form-group").addClass("snap-form-visibility"),label=$(availablity).find("label"),select=$(availablity).find("select");if($(label).insertBefore(select),$(label).text(M.util.get_string("visibility","theme_snap")+" "),$("#page-course-edit").length){var strDisabled="";str.get_strings([{key:"showallsectionsdisabled",component:"theme_snap"},{key:"disabled",component:"theme_snap"}]).then((function(strings){var strMessage=strings[0];return strDisabled=strings[1],templates.render("theme_snap/form_alert",{type:"warning",classes:"",message:strMessage})})).then((function(html){var op0=$('[name="coursedisplay"] > option[value="0"]'),op1=$('[name="coursedisplay"] > option[value="1"]'),selectNode=$('[name="coursedisplay"]');op0.attr("disabled","disabled"),op0.append(" ("+strDisabled+")"),op0.removeAttr("selected"),op1.attr("selected","selected"),selectNode.parent().append(html)}))}$(".snap-form-advanced").prepend(availablity);var savebuttons=$('form[id^="mform1"] > .form-group:last');$(mainForm).append(savebuttons);var errorElements=$(".form-group.has-danger");onModSettings&&errorElements.length&&errorElements.closest(".collapsible").removeClass("collapsed"),$("#page-mod-page-mod").length&&(str.get_strings([{key:"showappearancedisabled",component:"theme_snap"}]).then((function(localizedstring){return templates.render("theme_snap/form_alert",{type:"warning",classes:"",message:localizedstring})})).then((function(html){var pageInputs=$('[id="id_printheading"], [id="id_printintro"], [id="id_printlastmodified"], [id="id_display"], [id="id_popupwidth"], [id="id_popupheight"]');$("#id_display option:not(:selected)").attr("disabled",!0),pageInputs.attr("readonly",!0),$("#id_display").attr("disabled",!0),pageInputs.attr("tabindex",-1),pageInputs.click((function(e){return e.preventDefault(),!1})),pageInputs.parent().parent().parent().css("background-color","#f1f1f1"),pageInputs.parent().parent().parent().css("color","#d5d5d5"),$("#id_appearancehdrcontainer").append(html)})),$("#id_showdescription").parent().parent().parent().hide())}if(onSectionSettings&&$("#page-course-editsection.format-topics .form-group #id_name_value").length){document.getElementById("id_name_value").hasAttribute("disabled")&&document.getElementById("id_name_value").removeAttribute("disabled")}messageBadgeCountEnabled&&require(["theme_snap/conversation_badge_count-lazy"],(function(conversationBadgeCount){conversationBadgeCount.init(userId)})),$(".message-app .list-group").on("click",".list-group-item.list-group-item-action",(function(e){require(["theme_snap/conversation_badge_count-lazy"],(function(conversationBadgeCount){let conversationId=e.currentTarget.attributes["data-conversation-id"].value;conversationBadgeCount.init(userId,conversationId)}))}));var focustarget=$("#snap-coverimagecontrol label");focustarget&&focustarget.length&&focustarget.keypress((function(e){13===e.which&&$("#snap-coverfiles").trigger("click")})),$(".block_settings").length||($("#admin-menu-trigger").hide(),inAlternativeRole&&require(["theme_snap/alternative_role_handler-lazy"],(function(alternativeRoleHandler){alternativeRoleHandler.init(courseConfig.id)})));var lastElement,customMenu=$("ul.snap-navbar-content li:first-child a"),moodlePage=$("#moodle-page a:first"),notificationsBtn=$("#nav-notification-popover-container > div.popover-region-toggle.nav-link"),searchButton=$("#mr-nav .simplesearchform a.btn.btn-open"),adminMenuTrigger=$("#admin-menu-trigger");lastElement=customMenu.length?customMenu:moodlePage,notificationsBtn.length&&searchButton.length&&adminMenuTrigger.length&&lastElement.length&&require(["theme_snap/rearrange_tab_handler-lazy"],(function(searchTabHandler){searchTabHandler.init([notificationsBtn,searchButton,adminMenuTrigger,lastElement])})),$(".snap-settings-tab-link").on("click",(function(){var tab=$('a[href="'+$(this).attr("href")+'"].nav-link');tab.length&&tab.tab("show")})),"#course-detail-title"===window.location.hash&&$("#mr-nav").removeClass("headroom--pinned").addClass("headroom--unpinned");var savebuttonsformrequired=$("div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem");if($(window).width()<767&&$(".snap-form-advanced").append(savebuttonsformrequired),$(".path-mod.theme-snap #id_coursecontentnotification").length){const notificationCheck=document.getElementById("id_coursecontentnotification").closest(".form-group.fitem"),submitButtons=$('.snap-form-required [data-groupname="buttonar"]');null!==notificationCheck&&submitButtons.length&&(notificationCheck.classList.add("snap_content_notification_check"),submitButtons.before(notificationCheck))}if($("#page-home.theme-snap .intelliboard-page").length&&$(".snap-page-heading-button").length){document.getElementsByClassName("snap-page-heading-button")[0].classList.add("hidden")}const editingButton=$("#page-grade-report-singleview-index .grade_report_edit_button");editingButton.length&&!$(".search-widget.dropdown").length&&editingButton.addClass("hidden");var targetTilesSect=document.querySelector("section#tiles-section");if(null!==targetTilesSect){new MutationObserver((function(){util.processAnimatedImages()})).observe(targetTilesSect,{childList:!0,subtree:!0})}!function(){var i=0,checker=setInterval((function(){(i+=1)>15?clearInterval(checker):0!=$("button.atto_fullscreen_button").length&&0!=$("div.editor_atto").length&&($("button.atto_fullscreen_button").click((function(){$("div.editor_atto").css("background-color","#eee"),$("div.editor_atto").css("z-index","1")})),$("button.atto_html_button").click((function(){$("#id_introeditor").css("z-index","1")})),clearInterval(checker))}),2e3)}()})),accessibility.snapAxInit(),messages.init(),$("div#goto-top-link > a").click((function(){window.scrollTo({top:0,behavior:"smooth"}),$("body").find("a, [tabindex=0]").first().focus()}));var noneditingblocks={blockxp:"#page-blocks-xp-index"};for(var block in noneditingblocks){!0===$(noneditingblocks[block]).hasClass("editing")&&$(noneditingblocks[block]).removeClass("editing")}$(".togglecompletion").on("submit",(function(){!0===$(".togglecompletion").hasClass("forcereload")&&setTimeout((function(){location.reload(!0)}),1500)})),document.body.classList.contains("snap-resource-card")||document.querySelectorAll(".activityiconcontainer.url").forEach((urlDiv=>{urlDiv.querySelector('img[src*="/theme/image.php/snap/core/"][src*="/f/"]')&&(urlDiv.style.backgroundColor="inherit")}))}}})); //# sourceMappingURL=snap.min.js.map \ No newline at end of file diff --git a/theme/snap/amd/build/snap.min.js.map b/theme/snap/amd/build/snap.min.js.map index 14fa3308b8dc8..81d51f2c7e52a 100644 --- a/theme/snap/amd/build/snap.min.js.map +++ b/theme/snap/amd/build/snap.min.js.map @@ -1 +1 @@ -{"version":3,"file":"snap.min.js","sources":["../src/snap.js"],"sourcesContent":["/**\n * This file is part of Moodle - http://moodle.org/\n *\n * Moodle is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Moodle is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Moodle. If not, see .\n *\n * @package\n * @copyright Copyright (c) 2015 Open LMS (https://www.openlms.net)\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/* exported snapInit */\n/* eslint no-invalid-this: \"warn\"*/\n\n/**\n * Main snap initialising function.\n */\ndefine(['jquery', 'core/log', 'theme_snap/headroom', 'theme_snap/util', 'theme_snap/personal_menu',\n 'theme_snap/cover_image', 'theme_snap/progressbar', 'core/templates', 'core/str', 'theme_snap/accessibility',\n 'theme_snap/messages', 'theme_snap/scroll'],\n function($, log, Headroom, util, personalMenu, coverImage, ProgressBar, templates, str, accessibility, messages, Scroll) {\n\n 'use strict';\n\n /* eslint-disable camelcase */\n M.theme_snap = M.theme_snap || {};\n /* eslint-enable camelcase */\n\n /**\n * master switch for logging\n * @type {boolean}\n */\n var loggingenabled = false;\n\n if (!loggingenabled) {\n log.disableAll(true);\n } else {\n log.enableAll(true);\n }\n\n /**\n * Initialize pre SCSS and grading constants.\n * New variables can be initialized if necessary.\n * These variables are being passed from classes/output/shared.php,\n * and being updated from php constants in snapInit.\n */\n var brandColorSuccess = '';\n var brandColorWarning = '';\n var GRADE_DISPLAY_TYPE_PERCENTAGE = '';\n var GRADE_DISPLAY_TYPE_PERCENTAGE_REAL = '';\n var GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER = '';\n var GRADE_DISPLAY_TYPE_REAL = '';\n var GRADE_DISPLAY_TYPE_REAL_PERCENTAGE = '';\n var GRADE_DISPLAY_TYPE_REAL_LETTER = '';\n\n /**\n * Get all url parameters from href\n * @param {string} href\n * @returns {Array}\n */\n var getURLParams = function(href) {\n // Create temporary array from href.\n var ta = href.split('?');\n if (ta.length < 2) {\n return false; // No url params\n }\n // Get url params full string from href.\n var urlparams = ta[1];\n\n // Strip out hash component\n urlparams = urlparams.split('#')[0];\n\n // Get urlparam items.\n var items = urlparams.split('&');\n\n // Create params array of values hashed by key.\n var params = [];\n for (var i = 0; i < items.length; i++) {\n var item = items[i].split('=');\n var key = item[0];\n var val = item[1];\n params[key] = val;\n }\n return (params);\n };\n\n /**\n * Change save and cancel buttons from forms to the bottom on mobile mode.\n */\n $(window).on('resize', function() {\n mobileFormChecker();\n updateGraderHeadersTop();\n });\n\n var mobileFormChecker = function() {\n var savebuttonsformrequired = $('div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem');\n var savebuttonsformadvanced = $('div[role=main] .mform div.snap-form-advanced > div:nth-of-type(3)');\n var width = $(window).width();\n if (width < 992) {\n $('.snap-form-advanced').append(savebuttonsformrequired);\n } else if (width > 992) {\n $('.snap-form-required fieldset#id_general').append(savebuttonsformadvanced);\n }\n };\n\n const updateGraderHeadersTop = function() {\n const graderHeader = $('.path-grade-report-grader .gradeparent tr.heading');\n if (graderHeader.length) {\n graderHeader.css('top', $('#mr-nav').height() + 'px');\n }\n };\n\n const regionMain = $('.path-grade-report-grader #region-main div[role=\"main\"]');\n if (regionMain.length > 0) {\n const gradeParent = regionMain[0].querySelector('.gradeparent');\n if (gradeParent) {\n regionMain.addClass('snap-grade-reporter');\n }\n }\n\n updateGraderHeadersTop();\n\n /**\n * Move PHP errors into header\n *\n * @author Guy Thomas\n * @date 2014-05-19\n */\n var movePHPErrorsToHeader = function() {\n // Remove
tags inserted before xdebug-error.\n var xdebugs = $('.xdebug-error');\n if (xdebugs.length) {\n for (var x = 0; x < xdebugs.length; x++) {\n var el = xdebugs[x];\n var fontel = el.parentNode;\n var br = $(fontel).prev('br');\n $(br).remove();\n }\n }\n\n // Get messages using the different classes we want to use to target debug messages.\n var msgs = $('.xdebug-error, .php-debug, .debuggingmessage');\n\n if (msgs.length) {\n // OK we have some errors - lets shove them in the footer.\n $(msgs).addClass('php-debug-footer');\n var errorcont = $('

' +\n M.util.get_string('debugerrors', 'theme_snap') +\n '


');\n $('#page-footer').append(errorcont);\n $('#footer-error-cont').append(msgs);\n // Add rulers\n $('.php-debug-footer').after($('
'));\n // Lets also add the error class to the header so we know there are some errors.\n $('#mr-nav').addClass('errors-found');\n // Lets add an error link to the header.\n var errorlink = $('' +\n M.util.get_string('problemsfound', 'theme_snap') + ' ' + (msgs.length) + '');\n $('#page-header').append(errorlink);\n }\n };\n\n /**\n * Are we on the course page?\n * Note: This doesn't mean that we are in a course - Being in a course could mean that you are on a module page.\n * This means that you are actually on the course page.\n * @returns {boolean}\n */\n var onCoursePage = function() {\n return $('body').attr('id').indexOf('page-course-view-') === 0;\n };\n\n /**\n * Apply block hash to form actions etc if necessary.\n */\n /* eslint-disable no-invalid-this */\n var applyBlockHash = function() {\n // Add block hash to add block form.\n if (onCoursePage()) {\n $('.block_adminblock form').each(function() {\n /* eslint-disable no-invalid-this */\n $(this).attr('action', $(this).attr('action') + '#coursetools');\n });\n }\n\n if (location.hash !== '') {\n return;\n }\n\n var urlParams = getURLParams(location.href);\n\n // If calendar navigation has been clicked then go back to calendar.\n if (onCoursePage() && typeof (urlParams.time) !== 'undefined') {\n location.hash = 'coursetools';\n if ($('.block_calendar_month')) {\n util.scrollToElement($('.block_calendar_month'));\n }\n }\n\n // Form selectors for applying blocks hash.\n var formselectors = [\n 'body.path-blocks-collect #notice form'\n ];\n\n // There is no decent selector for block deletion so we have to add the selector if the current url has the\n // appropriate parameters.\n var paramchecks = ['bui_deleteid', 'bui_editid'];\n for (var p in paramchecks) {\n var param = paramchecks[p];\n if (typeof (urlParams[param]) !== 'undefined') {\n formselectors.push('#notice form');\n break;\n }\n }\n\n // If required, apply #coursetools hash to form action - this is so that on submitting form it returns to course\n // page on blocks tab.\n $(formselectors.join(', ')).each(function() {\n // Only apply the blocks hash if a hash is not already present in url.\n var formurl = $(this).attr('action');\n if (formurl.indexOf('#') === -1\n && (formurl.indexOf('/course/view.php') > -1)\n ) {\n $(this).attr('action', $(this).attr('action') + '#coursetools');\n }\n });\n };\n\n /**\n * Set forum strings because there isn't a decent renderer for mod/forum\n * It would be great if the official moodle forum module used a renderer for all output\n *\n * @author Guy Thomas\n * @date 2014-05-20\n */\n var setForumStrings = function() {\n $('.path-mod-forum tr.discussion td.topic.starter').attr('data-cellname',\n M.util.get_string('forumtopic', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.picture:not(\\'.group\\')').attr('data-cellname',\n M.util.get_string('forumauthor', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.picture.group').attr('data-cellname',\n M.util.get_string('forumpicturegroup', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.replies').attr('data-cellname',\n M.util.get_string('forumreplies', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.lastpost').attr('data-cellname',\n M.util.get_string('forumlastpost', 'theme_snap'));\n };\n\n /**\n * Process toc search string - trim, remove case sensitivity etc.\n *\n * @author Guy Thomas\n * @param {string} searchString\n * @returns {string}\n */\n var processSearchString = function(searchString) {\n searchString = searchString.trim().toLowerCase();\n return (searchString);\n };\n\n /**\n * Search course modules\n *\n * @author Stuart Lamour\n * @param {array} dataList\n */\n var tocSearchCourse = function(dataList) {\n // Keep search input open\n var i;\n var ua = window.navigator.userAgent;\n if (ua.indexOf('MSIE ') || ua.indexOf('Trident/')) {\n // We have reclone datalist over again for IE, or the same search fails the second time round.\n dataList = $(\"#toc-searchables\").find('li').clone(true);\n }\n\n // TODO - for 2.7 process search string called too many times?\n var searchString = $(\"#toc-search-input\").val();\n searchString = processSearchString(searchString);\n\n if (searchString.length === 0) {\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n\n } else {\n $(\"#toc-search-input\").addClass('state-active');\n var matches = [];\n for (i = 0; i < dataList.length; i++) {\n var dataItem = dataList[i];\n if (processSearchString($(dataItem).text()).indexOf(searchString) > -1) {\n matches.push(dataItem);\n }\n }\n $('#toc-search-results').html(matches);\n }\n };\n\n /**\n * Apply body classes which could not be set by renderers - e.g. when a notice was outputted.\n * We could do this in plain CSS if there was such a think as a parent selector.\n */\n var bodyClasses = function() {\n var extraclasses = [];\n if ($('#notice.snap-continue-cancel').length) {\n extraclasses.push('hascontinuecancel');\n }\n $('body').addClass(extraclasses.join(' '));\n };\n\n /**\n * Listen for hash changes / popstates.\n * @param {CourseLibAmd} courseLib\n */\n var listenHashChange = function(courseLib) {\n var lastHash = location.hash;\n $(window).on('popstate hashchange', function(e) {\n var newHash = location.hash;\n log.info('hashchange');\n if (newHash !== lastHash) {\n if (location.hash === '#primary-nav') {\n personalMenu.update();\n } else {\n $('#page, #moodle-footer, #js-snap-pm-trigger, #logo, .skiplinks').css('display', '');\n if (onCoursePage()) {\n log.info('show section', e.target);\n courseLib.showSection();\n }\n }\n }\n lastHash = newHash;\n });\n };\n\n /**\n * Course footer recent activity dom re-order.\n */\n var recentUpdatesFix = function() {\n $('#snap-course-footer-recent-activity .info').each(function() {\n $(this).appendTo($(this).prev());\n });\n $('#snap-course-footer-recent-activity .head .name').each(function() {\n $(this).prependTo($(this).closest(\".head\"));\n });\n };\n\n /**\n * Apply progressbar.js for circular progress displays.\n * @param {node} nodePointer\n * @param {function} dataCallback\n * @param {function} valueCallback\n */\n var createColoredDataCircle = function(nodePointer, dataCallback, valueCallback = null) {\n var circle = new ProgressBar.Circle(nodePointer, {\n color: 'inherit', // @gray.\n easing: 'linear',\n strokeWidth: 6,\n trailWidth: 3,\n duration: 1400,\n text: {\n value: '0'\n }\n });\n var value = ($(nodePointer).attr('value') / 100);\n var endColor = brandColorSuccess; // Green @brand-success.\n if (value === 0 || $(nodePointer).attr('value') === '-') {\n circle.setText('-');\n } else {\n if ($(nodePointer).attr('value') < 50) {\n endColor = brandColorWarning; // Orange @brand-warning.\n }\n circle.setText(dataCallback(nodePointer));\n }\n var valueAnimate = 0;\n\n if (valueCallback === null) {\n valueAnimate = value;\n } else {\n valueAnimate = valueCallback(nodePointer);\n }\n circle.animate(valueAnimate, {\n from: {\n color: '#999' // @gray-light.\n },\n to: {\n color: endColor\n },\n step: function(state, circle) {\n circle.path.setAttribute('stroke', state.color);\n }\n });\n };\n\n var progressbarcircle = function() {\n $('.snap-student-dashboard-progress .js-progressbar-circle').each(function() {\n createColoredDataCircle(this, function(nodePointer) {\n return $(nodePointer).attr('value') + '%';\n });\n });\n\n $('.snap-student-dashboard-grade .js-progressbar-circle').each(function() {\n createColoredDataCircle(this, function(nodePointer) {\n var nodeValue = $(nodePointer).attr('value');\n var gradeFormat = $(nodePointer).attr('gradeformat');\n\n /**\n * Definitions for gradebook.\n *\n * We need to display the % for all the grade formats which contains a % in the value.\n */\n if (gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE\n || gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE_REAL\n || gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER) {\n nodeValue = nodeValue + '%';\n }\n return nodeValue;\n }, function(nodePointer) {\n var valueAnimate = $(nodePointer).attr('value');\n var gradeFormat = $(nodePointer).attr('gradeformat');\n\n if (gradeFormat == GRADE_DISPLAY_TYPE_REAL\n || gradeFormat == GRADE_DISPLAY_TYPE_REAL_PERCENTAGE\n || gradeFormat == GRADE_DISPLAY_TYPE_REAL_LETTER) {\n valueAnimate = 0;\n } else {\n valueAnimate = ($(nodePointer).attr('value') / 100);\n }\n return valueAnimate;\n });\n });\n };\n\n /**\n * Add listeners.\n *\n * just a wrapper for various snippets that add listeners\n */\n var addListeners = function() {\n var selectors = [\n '.chapters a',\n '.section_footer a',\n ' #toc-search-results a'\n ];\n\n $(document).on('click', selectors.join(', '), function(e) {\n var href = this.getAttribute('href');\n if (window.history && window.history.pushState) {\n history.pushState(null, null, href);\n // Force hashchange fix for FF & IE9.\n $(window).trigger('hashchange');\n // Prevent scrolling to section.\n e.preventDefault();\n } else {\n location.hash = href;\n }\n });\n\n // Show fixed header on scroll down\n // using headroom js - http://wicky.nillia.ms/headroom.js/\n var myElement = document.querySelector(\"#mr-nav\");\n // Functions added to trigger on pin and unpin actions for the nav bar\n var onPin = () => {\n $('.snap-drawer-no-headroom').addClass('snap-drawer-headroom');\n $('.snap-drawer-headroom').removeClass('snap-drawer-no-headroom');\n };\n var onUnpin = () => {\n $('.snap-drawer-headroom').addClass('snap-drawer-no-headroom');\n $('.snap-drawer-no-headroom').removeClass('snap-drawer-headroom');\n };\n // Construct an instance of Headroom, passing the element.\n var headroom = new Headroom(myElement, {\n \"tolerance\": 5,\n \"offset\": 100,\n \"classes\": {\n // When element is initialised\n initial: \"headroom\",\n // When scrolling up\n pinned: \"headroom--pinned\",\n // When scrolling down\n unpinned: \"headroom--unpinned\",\n // When above offset\n top: \"headroom--top\",\n // When below offset\n notTop: \"headroom--not-top\"\n },\n \"onPin\": onPin,\n \"onUnpin\": onUnpin\n });\n // When not signed in always show mr-nav?\n if (!$('.notloggedin').length) {\n headroom.init();\n }\n\n // Listener for toc search.\n var dataList = $(\"#toc-searchables\").find('li').clone(true);\n $('#course-toc').on('keyup', '#toc-search-input', function() {\n tocSearchCourse(dataList);\n });\n\n // Handle keyboard navigation of search items.\n $('#course-toc').on('keydown', '#toc-search-input', function(e) {\n var keyCode = e.keyCode || e.which;\n if (keyCode === 9) {\n // 9 tab\n // 13 enter\n // 40 down arrow\n // Register listener for exiting search result.\n $('#toc-search-results a').last().blur(function() {\n $(this).off('blur'); // Unregister listener\n $(\"#toc-search-input\").val('');\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n });\n\n }\n });\n\n $('#course-toc').on(\"click\", '#toc-search-results a', function() {\n $(\"#toc-search-input\").val('');\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n });\n\n /**\n * When the document is clicked, if the closest object that was clicked was not the search input then close\n * the search results.\n * Note that this is triggered also when you click on a search result as the results should no longer be\n * required at that point.\n */\n $(document).on('click', function(event) {\n if (!$(event.target).closest('#toc-search-input').length) {\n $(\"#toc-search-input\").val('');\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n }\n });\n\n // Onclick for toggle of state-visible of admin block and mobile menu.\n $(document).on(\"click\", \"#admin-menu-trigger, #toc-mobile-menu-toggle\", function(e) {\n var href = this.getAttribute('href');\n // Make this only happen for settings button.\n if (this.getAttribute('id') === 'admin-menu-trigger') {\n $(this).toggleClass('active');\n $('#page').toggleClass('offcanvas');\n }\n $(href).attr('tabindex', '0');\n $(href).toggleClass('state-visible').focus();\n e.preventDefault();\n\n if ($('.message-app.main').length === 0) {\n document.dispatchEvent(new Event(\"messages-drawer:toggle\"));\n }\n });\n\n // Mobile menu button.\n $(document).on(\"click\", \"#course-toc.state-visible a\", function() {\n $('#course-toc').removeClass('state-visible');\n });\n\n // Reset videos, when changing section (INT-18208).\n $(document).on(\"click\", \".section_footer a, .chapter-title, .toc-footer a\", function() {\n const videos = $('[title=\"watch\"], .video-js, iframe:not([id])');\n for (let i = 0; i < videos.length; i++) {\n if (videos[i].classList.contains('video-js')) {\n if (videos[i].classList.contains('vjs-playing')) {\n let videoButton = videos[i].querySelector('.vjs-play-control.vjs-control.vjs-button');\n videoButton.click(); // Stop for videos using video-js Plugin.\n }\n } else if (videos[i].nodeName === 'IFRAME') {\n if (videos[i].src.includes(\"vimeo\")) {\n videos[i].src += \"\"; // Stop for Vimeo embedded videos.\n }\n } else {\n videos[i].querySelector('iframe').src += \"\"; // Stop for Youtube embedded videos.\n }\n }\n });\n\n $(document).on('click', '.news-article .toggle', function(e) {\n var $news = $(this).closest('.news-article');\n var $newstoggle = $(this);\n var $newsclose = $news.find('.news-article-message > div > a[role=\"button\"]');\n util.scrollToElement($news);\n $('.news-article').not($news).removeClass('state-expanded');\n $('.news-article .toggle').not($newstoggle).attr('aria-expanded', 'false');\n $('.news-article-message > div > a[role=\"button\"]').not($newsclose).attr('aria-expanded', 'false');\n $('.news-article-message').css('display', 'none');\n\n $news.toggleClass('state-expanded');\n if (!$news.attr('state-expanded')) {\n $news.focus();\n $newstoggle.attr('aria-expanded', 'false');\n $newsclose.attr('aria-expanded', 'false');\n }\n $('.state-expanded').find('.news-article-message').slideDown(\"fast\", function() {\n // Animation complete.\n if ($news.is('.state-expanded')) {\n $news.find('.news-article-message').focus();\n $newstoggle.attr('aria-expanded', 'true');\n $newsclose.attr('aria-expanded', 'true');\n } else {\n $news.focus();\n $newstoggle.attr('aria-expanded', 'false');\n $newsclose.attr('aria-expanded', 'false');\n }\n $(document).trigger('snapContentRevealed');\n });\n e.preventDefault();\n });\n\n // Add listeners for pausing animated images.\n $(document).on('click', '.anim-play-button', function() {\n $(this).parent().prev().css('visibility', 'visible');\n });\n $(document).on('click', '.anim-pause-button', function() {\n $(this).parent().prev().css('visibility', 'hidden');\n });\n\n // Initialise the scroll event listener.\n (new Scroll()).init();\n\n // Bootstrap js elements.\n\n // Initialise core bootstrap tooltip js.\n $(function() {\n var supportsTouch = false;\n if ('ontouchstart' in window) {\n // IOS & android\n supportsTouch = true;\n } else if (window.navigator.msPointerEnabled) {\n // Win8\n supportsTouch = true;\n }\n if (!supportsTouch) {\n var tooltipNode = $('[data-toggle=\"tooltip\"]');\n if ($.isFunction(tooltipNode.tooltip)) {\n tooltipNode.tooltip();\n }\n }\n });\n };\n\n /**\n * Function to fix the styles when fullscreen is used with Atto Editor.\n */\n function waitForFullScreenButton() {\n var maxIterations = 15;\n var i = 0;\n var checker = setInterval(function() {\n i = i + 1;\n if (i > maxIterations) {\n clearInterval(checker);\n } else {\n if ($('button.atto_fullscreen_button').length != 0 && $('div.editor_atto').length != 0) {\n $('button.atto_fullscreen_button').click(function() {\n $('div.editor_atto').css('background-color', '#eee');\n $('div.editor_atto').css('z-index', '1');\n });\n $('button.atto_html_button').click(function() {\n $('#id_introeditor').css('z-index', '1');\n });\n clearInterval(checker);\n }\n }\n }, 2000);\n }\n\n /**\n * AMD return object.\n */\n return {\n /**\n * Snap initialise function.\n * @param {object} courseConfig\n * @param {bool} pageHasCourseContent\n * @param {int} siteMaxBytes\n * @param {bool} forcePassChange\n * @param {bool} messageBadgeCountEnabled\n * @param {int} userId\n * @param {bool} sitePolicyAcceptReqd\n * @param {bool} inAlternativeRole\n * @param {string} brandColors\n * @param {int} gradingConstants\n */\n snapInit: function(courseConfig, pageHasCourseContent, siteMaxBytes, forcePassChange,\n messageBadgeCountEnabled, userId, sitePolicyAcceptReqd, inAlternativeRole,\n brandColors, gradingConstants) {\n\n // Set up.\n\n // Branding colors. New colors can be set up if necessary.\n brandColorSuccess = brandColors.success;\n brandColorWarning = brandColors.warning;\n // Grading constants for percentage.\n GRADE_DISPLAY_TYPE_PERCENTAGE = gradingConstants.gradepercentage;\n GRADE_DISPLAY_TYPE_PERCENTAGE_REAL = gradingConstants.gradepercentagereal;\n GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER = gradingConstants.gradepercentageletter;\n GRADE_DISPLAY_TYPE_REAL = gradingConstants.gradereal;\n GRADE_DISPLAY_TYPE_REAL_PERCENTAGE = gradingConstants.graderealpercentage;\n GRADE_DISPLAY_TYPE_REAL_LETTER = gradingConstants.graderealletter;\n\n M.cfg.context = courseConfig.contextid;\n M.snapTheme = {forcePassChange: forcePassChange};\n\n // General AMD modules.\n personalMenu.init(sitePolicyAcceptReqd);\n\n // Course related AMD modules (note, site page can technically have course content too).\n if (pageHasCourseContent) {\n require(\n [\n 'theme_snap/course-lazy'\n ], function(CourseLibAmd) {\n // Instantiate course lib.\n var courseLib = new CourseLibAmd(courseConfig);\n\n // Hash change listener goes here because it requires courseLib.\n listenHashChange(courseLib);\n }\n );\n }\n\n // When document has loaded.\n /* eslint-disable complexity */\n $(document).ready(function() {\n movePHPErrorsToHeader(); // Boring\n setForumStrings(); // Whatever\n addListeners(); // Essential\n applyBlockHash(); // Change location hash if necessary\n bodyClasses(); // Add body classes\n mobileFormChecker();\n util.processAnimatedImages();\n\n // Make sure that the blocks are always within page-content for assig view page.\n $('#page-mod-assign-view #page-content').append($('#moodle-blocks'));\n\n // Append resource card fadeout to content resource card.\n $('.snap-resource-long .contentafterlink .snap-resource-card-fadeout').each(function() {\n $(this).appendTo($(this).prevAll('.snap-resource-long .contentafterlink .no-overflow'));\n });\n\n // Remove from Dom the completion tracking when it is disabled for an activity.\n $('.snap-header-card .snap-header-card-icons .disabled-snap-asset-completion-tracking').remove();\n\n // Prepend asset type when activity is a folder to appear in the card header instead of the content.\n var folders = $('li.snap-activity.modtype_folder');\n $.each(folders, function(index, folder) {\n var content = $(folder).find('div.contentwithoutlink div.snap-assettype');\n if (content.length > 0) {\n if ($(folder).find('div.activityinstance div.snap-header-card .asset-type').length == 0) {\n var folderAssetTypeHeader = $(folder).find('div.activityinstance div.snap-header-card');\n content.prependTo(folderAssetTypeHeader);\n }\n }\n });\n\n // Add a class to the body to show js is loaded.\n $('body').addClass('snap-js-loaded');\n // Apply progressbar.js for circluar progress display.\n progressbarcircle();\n // Course footer recent updates dom fixes.\n recentUpdatesFix();\n\n if ($('body').hasClass('pagelayout-course') || $('body').hasClass('pagelayout-frontpage')) {\n coverImage.courseImage(courseConfig.shortname, siteMaxBytes);\n } else if ($('body').hasClass('pagelayout-coursecategory')) {\n if (courseConfig.categoryid) {\n coverImage.categoryImage(courseConfig.categoryid, siteMaxBytes);\n }\n }\n\n // Allow deeplinking to bs tabs on snap settings page.\n if ($('#page-admin-setting-themesettingsnap').length) {\n var tabHash = location.hash;\n // Check link is to a tab hash.\n if (tabHash && $('.nav-link[href=\"' + tabHash + '\"]').length) {\n $('.nav-link[href=\"' + tabHash + '\"]').tab('show');\n $(window).scrollTop(0);\n }\n\n // Hide advanced feeds additional life time setting when advanced feeds are disabled.\n var changeNodeVisibilityOnChecked = function(selectorToCheck, selectorToChange) {\n var nodeToCheck = $(selectorToCheck),\nnodeToChange = $(selectorToChange);\n if (nodeToCheck.is(':checked')) {\n nodeToChange.show();\n return;\n }\n nodeToChange.hide();\n };\n var advFeedsCheckboxSelector = '#id_s_theme_snap_personalmenuadvancedfeedsenable';\n var advFeedsLifeTimeSelector = '#admin-personalmenuadvancedfeedslifetime';\n changeNodeVisibilityOnChecked(advFeedsCheckboxSelector, advFeedsLifeTimeSelector);\n $(advFeedsCheckboxSelector).on('click', function() {\n changeNodeVisibilityOnChecked(advFeedsCheckboxSelector, advFeedsLifeTimeSelector);\n });\n }\n\n // Add extra padding when the error validation message appears at the moment of enter a not valid\n // URL for feature spots.\n var firstlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_one_title_link span.error');\n var secondlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_two_title_link span.error');\n var thirdlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_three_title_link span.error');\n var titlelinksettingone = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_one_title_link .form-label');\n var titlelinksettingtwo = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_two_title_link .form-label');\n var titlelinksettingthree = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_three_title_link .form-label');\n // Create an extra Div to wrap title links settings to avoid line break.\n $('#page-admin-setting-themesettingsnap #themesnapfeaturespots ' +\n '#admin-fs_three_title').nextUntil('#page-admin-setting-themesettingsnap #themesnapfeaturespots ' +\n '#admin-fs_one_title_link_cb').wrapAll(\"\");\n var linktitlestyle = {'padding-bottom': '2.1em'};\n\n // We need to modify the padding of these elements depending on the case, because when validating\n // the link and throwing an error, this will create an extra height to the parent and can break\n // the visualization of the settings page for Feature spots.\n if ((firstlinkerror).length) {\n titlelinksettingtwo.css(linktitlestyle);\n titlelinksettingthree.css(linktitlestyle);\n }\n if ((secondlinkerror).length) {\n titlelinksettingone.css(linktitlestyle);\n titlelinksettingthree.css(linktitlestyle);\n }\n if ((thirdlinkerror).length) {\n titlelinksettingone.css(linktitlestyle);\n titlelinksettingtwo.css(linktitlestyle);\n }\n\n if ($('body').hasClass('snap-pm-open')) {\n personalMenu.update();\n }\n\n // SHAME - make section name creation mandatory\n if ($('#page-course-editsection.format-topics').length) {\n var usedefaultname = document.getElementById('id_name_customize'),\n sname = document.getElementById('id_name_value');\n usedefaultname.value = '1';\n usedefaultname.checked = true;\n sname.required = \"required\";\n // Make sure that section does have at least one character.\n $(sname).attr(\"pattern\", \".*\\\\S+.*\");\n $(usedefaultname).parent().css('display', 'none');\n\n // Enable the cancel button.\n $('#id_cancel').on('click', function() {\n $(sname).removeAttr('required');\n $(sname).removeAttr('pattern');\n return true;\n });\n // Make sure that in other formats, \"only spaces\" name is not available.\n } else {\n $('#id_name_value').attr(\"pattern\", \".*\\\\S+.*\");\n $('#id_cancel').on('click', function() {\n $(sname).removeAttr('pattern');\n return true;\n });\n }\n\n // Book mod print button, only show if print link already present.\n if ($('#page-mod-book-view a[href*=\"mod/book/tool/print/index.php\"]').length) {\n var urlParams = getURLParams(location.href);\n if (urlParams) {\n $('[data-block=\"_fake\"]').append('

' +\n '


' +\n M.util.get_string('printbook', 'booktool_print') +\n '

');\n }\n }\n\n var modSettingsIdRe = /^page-mod-.*-mod$/; // E.g. #page-mod-resource-mod or #page-mod-forum-mod\n var onModSettings = modSettingsIdRe.test($('body').attr('id')) && location.href.indexOf(\"modedit\") > -1;\n if (!onModSettings) {\n modSettingsIdRe = /^page-mod-.*-general$/;\n onModSettings = modSettingsIdRe.test($('body').attr('id')) && location.href.indexOf(\"modedit\") > -1;\n }\n var onCourseSettings = $('body').attr('id') === 'page-course-edit';\n var onSectionSettings = $('body').attr('id') === 'page-course-editsection';\n $('#page-mod-hvp-mod .h5p-editor-iframe').parent().css({\"display\": \"block\"});\n var pageBlacklist = ['page-mod-hvp-mod'];\n var pageNotInBlacklist = pageBlacklist.indexOf($('body').attr('id')) === -1;\n\n if ((onModSettings || onCourseSettings || onSectionSettings) && pageNotInBlacklist) {\n // Wrap advanced options in a div\n var vital = [\n ':first',\n '#page-course-edit #id_descriptionhdr',\n '#id_contentsection',\n '#id_general + #id_general', // Turnitin duplicate ID bug.\n '#id_content',\n '#page-mod-choice-mod #id_optionhdr',\n '#page-mod-workshop-mod #id_gradingsettings',\n '#page-mod-choicegroup-mod #id_miscellaneoussettingshdr',\n '#page-mod-choicegroup-mod #id_groups',\n '#page-mod-scorm-mod #id_packagehdr'\n ];\n vital = vital.join();\n\n $('form[id^=\"mform1\"] > fieldset').not(vital).wrapAll('
');\n\n // Add expand all to advanced column.\n $(\".snap-form-advanced\").append($(\".collapsible-actions\"));\n // Add collapsed to all fieldsets in advanced, except on course edit page.\n if (!$('#page-course-edit').length) {\n $(\".snap-form-advanced fieldset\").addClass('collapsed');\n }\n\n // Sanitize required input into a single fieldset\n var mainForm = $('form[id^=\"mform1\"] fieldset:first');\n var appendTo = $('form[id^=\"mform1\"] fieldset:first .fcontainer');\n\n var required = $('form[id^=\"mform1\"] > fieldset').not('form[id^=\"mform1\"] > fieldset:first');\n for (var i = 0; i < required.length; i++) {\n var content = $(required[i]).find('.fcontainer');\n $(appendTo).append(content);\n $(required[i]).remove();\n }\n $(mainForm).wrap('
');\n\n // Show the form buttons when adding multiple LTI activities.\n if ($('body#page-mod-lti-mod').length) {\n var multipleLTIActivities =\n document.querySelector('section#region-main form.mform > div[data-attribute=\"dynamic-import\"]');\n var LTIObserver = new MutationObserver(function() {\n $('fieldset#id_general > :nth-child(5)').detach()\n .appendTo('section#region-main > div[role=\"main\"] > form.mform');\n });\n var LTIObserverConfig = {childList: true};\n LTIObserver.observe(multipleLTIActivities, LTIObserverConfig);\n }\n\n var description = $('form[id^=\"mform1\"] fieldset:first .fitem_feditor:not(.required)');\n\n if (onModSettings && description) {\n var noNeedDescSelectors = [\n 'body#page-mod-assign-mod',\n 'body#page-mod-choice-mod',\n 'body#page-mod-turnitintool-mod',\n 'body#page-mod-workshop-mod',\n ];\n var addMultiMessageSelectors = [\n 'body#page-mod-url-mod',\n 'body#page-mod-resource-mod',\n 'body#page-mod-folder-mod',\n 'body#page-mod-imscp-mod',\n 'body#page-mod-lightboxgallery-mod',\n 'body#page-mod-scorm-mod',\n ];\n if ($(noNeedDescSelectors.join()).length === 0) {\n $(appendTo).append(description);\n $(appendTo).append($('#fitem_id_showdescription'));\n }\n // Resource cards - add a message to this type of activities, these activities will not display\n // any multimedia.\n if ($(addMultiMessageSelectors.join()).length > 0) {\n str.get_strings([\n {key: 'multimediacard', component: 'theme_snap'}\n ]).done(function(stringsjs) {\n var activityCards = stringsjs[0];\n var cardmultimedia = $(\"[id='id_showdescription']\").closest('.form-group');\n $(cardmultimedia).append(activityCards);\n });\n }\n }\n\n // Resources - put description in common mod settings.\n description = $(\"#page-mod-resource-mod [data-fieldtype='editor']\").closest('.form-group');\n var showdescription = $(\"#page-mod-resource-mod [id='id_showdescription']\").closest('.form-group');\n $(\"#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer\").append(description);\n $(\"#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer\").append(showdescription);\n\n // Assignment - put due date in required.\n var duedate = $(\"#page-mod-assign-mod [for='id_duedate']\").closest('.form-group');\n $(\"#page-mod-assign-mod .snap-form-required .fcontainer\").append(duedate);\n\n // Move availablity at the top of advanced settings.\n var availablity = $('#id_visible').closest('.form-group').addClass('snap-form-visibility');\n var label = $(availablity).find('label');\n var select = $(availablity).find('select');\n $(label).insertBefore(select);\n\n // SHAME - rewrite visibility form lang string to be more user friendly.\n $(label).text(M.util.get_string('visibility', 'theme_snap') + ' ');\n\n if ($(\"#page-course-edit\").length) {\n // We are in course editing form.\n // Removing the \"Show all sections in one page\" from the course format form.\n var strDisabled = \"\";\n (function() {\n return str.get_strings([\n {key: 'showallsectionsdisabled', component: 'theme_snap'},\n {key: 'disabled', component: 'theme_snap'}\n ]);\n })()\n .then(function(strings) {\n var strMessage = strings[0];\n strDisabled = strings[1];\n return templates.render('theme_snap/form_alert', {\n type: 'warning',\n classes: '',\n message: strMessage\n });\n })\n .then(function(html) {\n var op0 = $('[name=\"coursedisplay\"] > option[value=\"0\"]');\n var op1 = $('[name=\"coursedisplay\"] > option[value=\"1\"]');\n var selectNode = $('[name=\"coursedisplay\"]');\n // Disable option 0\n op0.attr('disabled', 'disabled');\n // Add \"(Disabled)\" to option text\n op0.append(' (' + strDisabled + ')');\n // Remove selection attribute\n op0.removeAttr(\"selected\");\n // Select option 1\n op1.attr('selected', 'selected');\n // Add warning\n selectNode.parent().append(html);\n });\n }\n\n $('.snap-form-advanced').prepend(availablity);\n\n // Add save buttons.\n var savebuttons = $('form[id^=\"mform1\"] > .form-group:last');\n $(mainForm).append(savebuttons);\n\n // Expand collapsed fieldsets when editing a mod that has errors in it.\n var errorElements = $('.form-group.has-danger');\n if (onModSettings && errorElements.length) {\n errorElements.closest('.collapsible').removeClass('collapsed');\n }\n\n // Hide appearance menu from interface when editing a page-resource.\n if ($(\"#page-mod-page-mod\").length) {\n // Chaining promises to get localized strings and render warning message.\n (function() {\n return str.get_strings([\n {key: 'showappearancedisabled', component: 'theme_snap'}\n ]);\n })()\n .then(function(localizedstring) {\n return templates.render('theme_snap/form_alert', {\n type: 'warning',\n classes: '',\n message: localizedstring\n });\n })\n // eslint-disable-next-line promise/always-return\n .then(function(html) {\n // Disable checkboxes.\n // Colors for disabling the divs.\n var layoverbkcolor = \"#f1f1f1\";\n var layovercolor = \"#d5d5d5\";\n var pageInputs = $('[id=\"id_printheading\"], [id=\"id_printintro\"],' +\n ' [id=\"id_printlastmodified\"], [id=\"id_display\"],' +\n ' [id=\"id_popupwidth\"], [id=\"id_popupheight\"]');\n\n // This will help with disable the multiple options for the select, and let the one by default.\n // Allowing to submit the form.\n $('#id_display option:not(:selected)').attr('disabled', true);\n\n // Note we can't use 'disabled' for settings or they don't get submitted.\n pageInputs.attr('readonly', true);\n $('#id_display').attr('disabled', true);\n pageInputs.attr('tabindex', -1); // Prevent tabbing to change val.\n pageInputs.click(function(e) {\n e.preventDefault();\n return false;\n });\n pageInputs.parent().parent().parent().css('background-color', layoverbkcolor);\n pageInputs.parent().parent().parent().css('color', layovercolor);\n\n // Add warning.\n var selectNode = $('#id_appearancehdrcontainer');\n selectNode.append(html);\n });\n $('#id_showdescription').parent().parent().parent().hide();\n }\n }\n // Remove disabled attribute for section name for topics format.\n if (onSectionSettings) {\n var sectionName = $(\"#page-course-editsection.format-topics .form-group #id_name_value\");\n if (sectionName.length) {\n let sectionNameIsDiabled = document.getElementById('id_name_value').hasAttribute(\"disabled\");\n if (sectionNameIsDiabled) {\n document.getElementById('id_name_value').removeAttribute(\"disabled\");\n }\n }\n }\n\n // Conversation counter for user badge.\n if (messageBadgeCountEnabled) {\n require(\n [\n 'theme_snap/conversation_badge_count-lazy'\n ], function(conversationBadgeCount) {\n conversationBadgeCount.init(userId);\n }\n );\n }\n\n // Update Messages badge without reloading the site.\n $('.message-app .list-group').on('click', '.list-group-item.list-group-item-action', function(e) {\n require(\n [\n 'theme_snap/conversation_badge_count-lazy'\n ], function(conversationBadgeCount) {\n let conversationId = e.currentTarget.attributes['data-conversation-id'].value;\n conversationBadgeCount.init(userId, conversationId);\n }\n );\n });\n\n // Listen to cover image label key press for accessible usage.\n var focustarget = $('#snap-coverimagecontrol label');\n if (focustarget && focustarget.length) {\n focustarget.keypress(function(e) {\n if (e.which === 13) {\n $('#snap-coverfiles').trigger('click');\n }\n });\n }\n\n // Review if settings block is missing.\n if (!$('.block_settings').length) {\n // Hide admin icon.\n $('#admin-menu-trigger').hide();\n if (inAlternativeRole) {\n // Handle possible alternative role.\n require(\n [\n 'theme_snap/alternative_role_handler-lazy'\n ], function(alternativeRoleHandler) {\n alternativeRoleHandler.init(courseConfig.id);\n }\n );\n }\n }\n\n // Add tab logic order to navigation bar icons, part of this order is being taken from the layout nav.php file.\n var customMenu = $('ul.snap-navbar-content li:first-child a');\n var moodlePage = $(\"#moodle-page a:first\");\n var notificationsBtn = $('#nav-notification-popover-container > div.popover-region-toggle.nav-link');\n var searchButton = $('#mr-nav .simplesearchform a.btn.btn-open');\n var adminMenuTrigger = $('#admin-menu-trigger');\n\n var lastElement;\n if (customMenu.length) {\n lastElement = customMenu;\n } else {\n lastElement = moodlePage;\n }\n if (notificationsBtn.length && searchButton.length && adminMenuTrigger.length && lastElement.length) {\n // Update tab events because all elements have tabindex=\"0\" and they are rendered funny.\n require(\n [\n 'theme_snap/rearrange_tab_handler-lazy'\n ], function(searchTabHandler) {\n searchTabHandler.init([notificationsBtn, searchButton, adminMenuTrigger, lastElement]);\n }\n );\n }\n\n // Add settings tab show behaviour to classes which want to do that.\n $('.snap-settings-tab-link').on('click', function() {\n var tab = $('a[href=\"' + $(this).attr('href') + '\"].nav-link');\n if (tab.length) {\n tab.tab('show');\n }\n });\n\n // Unpin headroom when url has #course-detail-title.\n if (window.location.hash === '#course-detail-title') {\n $('#mr-nav').removeClass('headroom--pinned').addClass('headroom--unpinned');\n }\n\n // Re position submit buttons for forms when using mobile mode at the bottom of the form.\n var savebuttonsformrequired = $('div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem');\n var width = $(window).width();\n if (width < 767) {\n $('.snap-form-advanced').append(savebuttonsformrequired);\n }\n\n // Fix a position for the new 'Send content change notification' setting.\n if ( $('.path-mod.theme-snap #id_coursecontentnotification').length ) {\n const notificationCheck = document.getElementById('id_coursecontentnotification')\n .closest(\".form-group.fitem\");\n const submitButtons = $('.snap-form-required [data-groupname=\"buttonar\"]');\n if (notificationCheck !== null && submitButtons.length) {\n notificationCheck.classList.add('snap_content_notification_check');\n submitButtons.before(notificationCheck);\n }\n }\n\n // Hide Blocks editing on button from the Intelliboard Dashboard page in Snap.\n if ( $('#page-home.theme-snap .intelliboard-page').length && $('.snap-page-heading-button').length) {\n const blocksEditingOnButton = document.getElementsByClassName('snap-page-heading-button')[0];\n blocksEditingOnButton.classList.add(\"hidden\");\n }\n\n // Hide edit button for main page in Grade report single view.\n const editingButton = $('#page-grade-report-singleview-index .grade_report_edit_button');\n if (editingButton.length && !$('.search-widget.dropdown').length) {\n editingButton.addClass(\"hidden\");\n }\n\n // Code for Tiles particular loading, needed before other scripts but after the document is ready.\n var targetTilesSect = document.querySelector('section#tiles-section');\n var configTilesSect = {childList: true, subtree: true};\n var observerTilesSect = new MutationObserver(function() {\n util.processAnimatedImages();\n });\n observerTilesSect.observe(targetTilesSect, configTilesSect);\n\n waitForFullScreenButton();\n });\n accessibility.snapAxInit();\n messages.init();\n\n // Smooth scroll for go to top button.\n $(\"div#goto-top-link > a\").click(function() {\n window.scrollTo({top: 0, behavior: 'smooth'});\n $('body').find('a, [tabindex=0]').first().focus();\n });\n\n // Blocks selectors to remove 'editing' class because is not necessary to access their settings.\n var noneditingblocks = {};\n noneditingblocks.blockxp = '#page-blocks-xp-index';\n\n // Remove 'editing' class actions.\n for (var block in noneditingblocks) {\n var blockisediting = $(noneditingblocks[block]).hasClass('editing');\n if (blockisediting === true) {\n $(noneditingblocks[block]).removeClass('editing');\n }\n }\n\n // Check Toggle Completion to force redirect to URL.\n const toggleCompletion = '.togglecompletion';\n const delay = 1500;\n $(toggleCompletion).on('submit', function() {\n var shouldReload = $(toggleCompletion).hasClass('forcereload');\n if (shouldReload === true) {\n setTimeout(function() {\n location.reload(true);\n }, delay);\n }\n });\n\n // Inherit transparent background color for divs containing non-default mod_url icons.\n if (!document.body.classList.contains('snap-resource-card')) { // Only for Snap Resource display List.\n document.querySelectorAll('.activityiconcontainer.url').forEach(urlDiv => {\n if (urlDiv.querySelector('img[src*=\"/theme/image.php/snap/core/\"][src*=\"/f/\"]')) {\n urlDiv.style.backgroundColor = 'inherit';\n }\n });\n }\n\n }\n };\n }\n);\n"],"names":["define","$","log","Headroom","util","personalMenu","coverImage","ProgressBar","templates","str","accessibility","messages","Scroll","M","theme_snap","disableAll","brandColorSuccess","brandColorWarning","GRADE_DISPLAY_TYPE_PERCENTAGE","GRADE_DISPLAY_TYPE_PERCENTAGE_REAL","GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER","GRADE_DISPLAY_TYPE_REAL","GRADE_DISPLAY_TYPE_REAL_PERCENTAGE","GRADE_DISPLAY_TYPE_REAL_LETTER","getURLParams","href","ta","split","length","urlparams","items","params","i","item","key","val","window","on","mobileFormChecker","updateGraderHeadersTop","savebuttonsformrequired","savebuttonsformadvanced","width","append","graderHeader","css","height","regionMain","querySelector","addClass","onCoursePage","attr","indexOf","processSearchString","searchString","trim","toLowerCase","createColoredDataCircle","nodePointer","dataCallback","valueCallback","circle","Circle","color","easing","strokeWidth","trailWidth","duration","text","value","endColor","setText","valueAnimate","animate","from","to","step","state","path","setAttribute","addListeners","document","join","e","this","getAttribute","history","pushState","trigger","preventDefault","location","hash","myElement","headroom","initial","pinned","unpinned","top","notTop","removeClass","init","dataList","find","clone","ua","navigator","userAgent","html","matches","dataItem","push","tocSearchCourse","keyCode","which","last","blur","off","event","target","closest","toggleClass","focus","dispatchEvent","Event","videos","classList","contains","click","nodeName","src","includes","$news","$newstoggle","$newsclose","scrollToElement","not","slideDown","is","parent","prev","supportsTouch","msPointerEnabled","tooltipNode","isFunction","tooltip","snapInit","courseConfig","pageHasCourseContent","siteMaxBytes","forcePassChange","messageBadgeCountEnabled","userId","sitePolicyAcceptReqd","inAlternativeRole","brandColors","gradingConstants","success","warning","gradepercentage","gradepercentagereal","gradepercentageletter","gradereal","graderealpercentage","graderealletter","cfg","context","contextid","snapTheme","require","CourseLibAmd","courseLib","lastHash","newHash","info","update","showSection","listenHashChange","ready","extraclasses","xdebugs","x","fontel","parentNode","br","remove","msgs","errorcont","get_string","after","errorlink","movePHPErrorsToHeader","each","urlParams","time","formselectors","paramchecks","p","formurl","applyBlockHash","processAnimatedImages","appendTo","prevAll","folders","index","folder","content","folderAssetTypeHeader","prependTo","nodeValue","gradeFormat","hasClass","courseImage","shortname","categoryid","categoryImage","tabHash","tab","scrollTop","changeNodeVisibilityOnChecked","selectorToCheck","selectorToChange","nodeToCheck","nodeToChange","show","hide","advFeedsCheckboxSelector","firstlinkerror","secondlinkerror","thirdlinkerror","titlelinksettingone","titlelinksettingtwo","titlelinksettingthree","nextUntil","wrapAll","linktitlestyle","usedefaultname","getElementById","sname","checked","required","removeAttr","id","modSettingsIdRe","onModSettings","test","onCourseSettings","onSectionSettings","pageNotInBlacklist","vital","mainForm","wrap","multipleLTIActivities","MutationObserver","detach","observe","childList","description","get_strings","component","done","stringsjs","activityCards","cardmultimedia","showdescription","duedate","availablity","label","select","insertBefore","strDisabled","then","strings","strMessage","render","type","classes","message","op0","op1","selectNode","prepend","savebuttons","errorElements","localizedstring","pageInputs","hasAttribute","removeAttribute","conversationBadgeCount","conversationId","currentTarget","attributes","focustarget","keypress","alternativeRoleHandler","lastElement","customMenu","moodlePage","notificationsBtn","searchButton","adminMenuTrigger","searchTabHandler","notificationCheck","submitButtons","add","before","getElementsByClassName","editingButton","targetTilesSect","subtree","checker","setInterval","clearInterval","waitForFullScreenButton","snapAxInit","scrollTo","behavior","first","noneditingblocks","block","setTimeout","reload","body","querySelectorAll","forEach","urlDiv","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BAA,yB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,iBAAiB,8BAA8BC,SAAQC,SACxDA,OAAOpR,cAAc,yDACrBoR,OAAOC,MAAMC,gBAAkB"} \ No newline at end of file +{"version":3,"file":"snap.min.js","sources":["../src/snap.js"],"sourcesContent":["/**\n * This file is part of Moodle - http://moodle.org/\n *\n * Moodle is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * Moodle is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with Moodle. If not, see .\n *\n * @package\n * @copyright Copyright (c) 2015 Open LMS (https://www.openlms.net)\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/* exported snapInit */\n/* eslint no-invalid-this: \"warn\"*/\n\n/**\n * Main snap initialising function.\n */\ndefine(['jquery', 'core/log', 'theme_snap/headroom', 'theme_snap/util', 'theme_snap/personal_menu',\n 'theme_snap/cover_image', 'theme_snap/progressbar', 'core/templates', 'core/str', 'theme_snap/accessibility',\n 'theme_snap/messages', 'theme_snap/scroll'],\n function($, log, Headroom, util, personalMenu, coverImage, ProgressBar, templates, str, accessibility, messages, Scroll) {\n\n 'use strict';\n\n /* eslint-disable camelcase */\n M.theme_snap = M.theme_snap || {};\n /* eslint-enable camelcase */\n\n /**\n * master switch for logging\n * @type {boolean}\n */\n var loggingenabled = false;\n\n if (!loggingenabled) {\n log.disableAll(true);\n } else {\n log.enableAll(true);\n }\n\n /**\n * Initialize pre SCSS and grading constants.\n * New variables can be initialized if necessary.\n * These variables are being passed from classes/output/shared.php,\n * and being updated from php constants in snapInit.\n */\n var brandColorSuccess = '';\n var brandColorWarning = '';\n var GRADE_DISPLAY_TYPE_PERCENTAGE = '';\n var GRADE_DISPLAY_TYPE_PERCENTAGE_REAL = '';\n var GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER = '';\n var GRADE_DISPLAY_TYPE_REAL = '';\n var GRADE_DISPLAY_TYPE_REAL_PERCENTAGE = '';\n var GRADE_DISPLAY_TYPE_REAL_LETTER = '';\n\n /**\n * Get all url parameters from href\n * @param {string} href\n * @returns {Array}\n */\n var getURLParams = function(href) {\n // Create temporary array from href.\n var ta = href.split('?');\n if (ta.length < 2) {\n return false; // No url params\n }\n // Get url params full string from href.\n var urlparams = ta[1];\n\n // Strip out hash component\n urlparams = urlparams.split('#')[0];\n\n // Get urlparam items.\n var items = urlparams.split('&');\n\n // Create params array of values hashed by key.\n var params = [];\n for (var i = 0; i < items.length; i++) {\n var item = items[i].split('=');\n var key = item[0];\n var val = item[1];\n params[key] = val;\n }\n return (params);\n };\n\n /**\n * Change save and cancel buttons from forms to the bottom on mobile mode.\n */\n $(window).on('resize', function() {\n mobileFormChecker();\n updateGraderHeadersTop();\n });\n\n var mobileFormChecker = function() {\n var savebuttonsformrequired = $('div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem');\n var savebuttonsformadvanced = $('div[role=main] .mform div.snap-form-advanced > div:nth-of-type(3)');\n var width = $(window).width();\n if (width < 992) {\n $('.snap-form-advanced').append(savebuttonsformrequired);\n } else if (width > 992) {\n $('.snap-form-required fieldset#id_general').append(savebuttonsformadvanced);\n }\n };\n\n const updateGraderHeadersTop = function() {\n const graderHeader = $('.path-grade-report-grader .gradeparent tr.heading');\n if (graderHeader.length) {\n graderHeader.css('top', $('#mr-nav').height() + 'px');\n }\n };\n\n const regionMain = $('.path-grade-report-grader #region-main div[role=\"main\"]');\n if (regionMain.length > 0) {\n const gradeParent = regionMain[0].querySelector('.gradeparent');\n if (gradeParent) {\n regionMain.addClass('snap-grade-reporter');\n }\n }\n\n updateGraderHeadersTop();\n\n /**\n * Move PHP errors into header\n *\n * @author Guy Thomas\n * @date 2014-05-19\n */\n var movePHPErrorsToHeader = function() {\n // Remove
tags inserted before xdebug-error.\n var xdebugs = $('.xdebug-error');\n if (xdebugs.length) {\n for (var x = 0; x < xdebugs.length; x++) {\n var el = xdebugs[x];\n var fontel = el.parentNode;\n var br = $(fontel).prev('br');\n $(br).remove();\n }\n }\n\n // Get messages using the different classes we want to use to target debug messages.\n var msgs = $('.xdebug-error, .php-debug, .debuggingmessage');\n\n if (msgs.length) {\n // OK we have some errors - lets shove them in the footer.\n $(msgs).addClass('php-debug-footer');\n var errorcont = $('

' +\n M.util.get_string('debugerrors', 'theme_snap') +\n '


');\n $('#page-footer').append(errorcont);\n $('#footer-error-cont').append(msgs);\n // Add rulers\n $('.php-debug-footer').after($('
'));\n // Lets also add the error class to the header so we know there are some errors.\n $('#mr-nav').addClass('errors-found');\n // Lets add an error link to the header.\n var errorlink = $('' +\n M.util.get_string('problemsfound', 'theme_snap') + ' ' + (msgs.length) + '');\n $('#page-header').append(errorlink);\n }\n };\n\n /**\n * Are we on the course page?\n * Note: This doesn't mean that we are in a course - Being in a course could mean that you are on a module page.\n * This means that you are actually on the course page.\n * @returns {boolean}\n */\n var onCoursePage = function() {\n return $('body').attr('id').indexOf('page-course-view-') === 0;\n };\n\n /**\n * Apply block hash to form actions etc if necessary.\n */\n /* eslint-disable no-invalid-this */\n var applyBlockHash = function() {\n // Add block hash to add block form.\n if (onCoursePage()) {\n $('.block_adminblock form').each(function() {\n /* eslint-disable no-invalid-this */\n $(this).attr('action', $(this).attr('action') + '#coursetools');\n });\n }\n\n if (location.hash !== '') {\n return;\n }\n\n var urlParams = getURLParams(location.href);\n\n // If calendar navigation has been clicked then go back to calendar.\n if (onCoursePage() && typeof (urlParams.time) !== 'undefined') {\n location.hash = 'coursetools';\n if ($('.block_calendar_month')) {\n util.scrollToElement($('.block_calendar_month'));\n }\n }\n\n // Form selectors for applying blocks hash.\n var formselectors = [\n 'body.path-blocks-collect #notice form'\n ];\n\n // There is no decent selector for block deletion so we have to add the selector if the current url has the\n // appropriate parameters.\n var paramchecks = ['bui_deleteid', 'bui_editid'];\n for (var p in paramchecks) {\n var param = paramchecks[p];\n if (typeof (urlParams[param]) !== 'undefined') {\n formselectors.push('#notice form');\n break;\n }\n }\n\n // If required, apply #coursetools hash to form action - this is so that on submitting form it returns to course\n // page on blocks tab.\n $(formselectors.join(', ')).each(function() {\n // Only apply the blocks hash if a hash is not already present in url.\n var formurl = $(this).attr('action');\n if (formurl.indexOf('#') === -1\n && (formurl.indexOf('/course/view.php') > -1)\n ) {\n $(this).attr('action', $(this).attr('action') + '#coursetools');\n }\n });\n };\n\n /**\n * Set forum strings because there isn't a decent renderer for mod/forum\n * It would be great if the official moodle forum module used a renderer for all output\n *\n * @author Guy Thomas\n * @date 2014-05-20\n */\n var setForumStrings = function() {\n $('.path-mod-forum tr.discussion td.topic.starter').attr('data-cellname',\n M.util.get_string('forumtopic', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.picture:not(\\'.group\\')').attr('data-cellname',\n M.util.get_string('forumauthor', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.picture.group').attr('data-cellname',\n M.util.get_string('forumpicturegroup', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.replies').attr('data-cellname',\n M.util.get_string('forumreplies', 'theme_snap'));\n $('.path-mod-forum tr.discussion td.lastpost').attr('data-cellname',\n M.util.get_string('forumlastpost', 'theme_snap'));\n };\n\n /**\n * Process toc search string - trim, remove case sensitivity etc.\n *\n * @author Guy Thomas\n * @param {string} searchString\n * @returns {string}\n */\n var processSearchString = function(searchString) {\n searchString = searchString.trim().toLowerCase();\n return (searchString);\n };\n\n /**\n * Search course modules\n *\n * @author Stuart Lamour\n * @param {array} dataList\n */\n var tocSearchCourse = function(dataList) {\n // Keep search input open\n var i;\n var ua = window.navigator.userAgent;\n if (ua.indexOf('MSIE ') || ua.indexOf('Trident/')) {\n // We have reclone datalist over again for IE, or the same search fails the second time round.\n dataList = $(\"#toc-searchables\").find('li').clone(true);\n }\n\n // TODO - for 2.7 process search string called too many times?\n var searchString = $(\"#toc-search-input\").val();\n searchString = processSearchString(searchString);\n\n if (searchString.length === 0) {\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n\n } else {\n $(\"#toc-search-input\").addClass('state-active');\n var matches = [];\n for (i = 0; i < dataList.length; i++) {\n var dataItem = dataList[i];\n if (processSearchString($(dataItem).text()).indexOf(searchString) > -1) {\n matches.push(dataItem);\n }\n }\n $('#toc-search-results').html(matches);\n }\n };\n\n /**\n * Apply body classes which could not be set by renderers - e.g. when a notice was outputted.\n * We could do this in plain CSS if there was such a think as a parent selector.\n */\n var bodyClasses = function() {\n var extraclasses = [];\n if ($('#notice.snap-continue-cancel').length) {\n extraclasses.push('hascontinuecancel');\n }\n $('body').addClass(extraclasses.join(' '));\n };\n\n /**\n * Listen for hash changes / popstates.\n * @param {CourseLibAmd} courseLib\n */\n var listenHashChange = function(courseLib) {\n var lastHash = location.hash;\n $(window).on('popstate hashchange', function(e) {\n var newHash = location.hash;\n log.info('hashchange');\n if (newHash !== lastHash) {\n if (location.hash === '#primary-nav') {\n personalMenu.update();\n } else {\n $('#page, #moodle-footer, #js-snap-pm-trigger, #logo, .skiplinks').css('display', '');\n if (onCoursePage()) {\n log.info('show section', e.target);\n courseLib.showSection();\n }\n }\n }\n lastHash = newHash;\n });\n };\n\n /**\n * Course footer recent activity dom re-order.\n */\n var recentUpdatesFix = function() {\n $('#snap-course-footer-recent-activity .info').each(function() {\n $(this).appendTo($(this).prev());\n });\n $('#snap-course-footer-recent-activity .head .name').each(function() {\n $(this).prependTo($(this).closest(\".head\"));\n });\n };\n\n /**\n * Apply progressbar.js for circular progress displays.\n * @param {node} nodePointer\n * @param {function} dataCallback\n * @param {function} valueCallback\n */\n var createColoredDataCircle = function(nodePointer, dataCallback, valueCallback = null) {\n var circle = new ProgressBar.Circle(nodePointer, {\n color: 'inherit', // @gray.\n easing: 'linear',\n strokeWidth: 6,\n trailWidth: 3,\n duration: 1400,\n text: {\n value: '0'\n }\n });\n var value = ($(nodePointer).attr('value') / 100);\n var endColor = brandColorSuccess; // Green @brand-success.\n if (value === 0 || $(nodePointer).attr('value') === '-') {\n circle.setText('-');\n } else {\n if ($(nodePointer).attr('value') < 50) {\n endColor = brandColorWarning; // Orange @brand-warning.\n }\n circle.setText(dataCallback(nodePointer));\n }\n var valueAnimate = 0;\n\n if (valueCallback === null) {\n valueAnimate = value;\n } else {\n valueAnimate = valueCallback(nodePointer);\n }\n circle.animate(valueAnimate, {\n from: {\n color: '#999' // @gray-light.\n },\n to: {\n color: endColor\n },\n step: function(state, circle) {\n circle.path.setAttribute('stroke', state.color);\n }\n });\n };\n\n var progressbarcircle = function() {\n $('.snap-student-dashboard-progress .js-progressbar-circle').each(function() {\n createColoredDataCircle(this, function(nodePointer) {\n return $(nodePointer).attr('value') + '%';\n });\n });\n\n $('.snap-student-dashboard-grade .js-progressbar-circle').each(function() {\n createColoredDataCircle(this, function(nodePointer) {\n var nodeValue = $(nodePointer).attr('value');\n var gradeFormat = $(nodePointer).attr('gradeformat');\n\n /**\n * Definitions for gradebook.\n *\n * We need to display the % for all the grade formats which contains a % in the value.\n */\n if (gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE\n || gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE_REAL\n || gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER) {\n nodeValue = nodeValue + '%';\n }\n return nodeValue;\n }, function(nodePointer) {\n var valueAnimate = $(nodePointer).attr('value');\n var gradeFormat = $(nodePointer).attr('gradeformat');\n\n if (gradeFormat == GRADE_DISPLAY_TYPE_REAL\n || gradeFormat == GRADE_DISPLAY_TYPE_REAL_PERCENTAGE\n || gradeFormat == GRADE_DISPLAY_TYPE_REAL_LETTER) {\n valueAnimate = 0;\n } else {\n valueAnimate = ($(nodePointer).attr('value') / 100);\n }\n return valueAnimate;\n });\n });\n };\n\n /**\n * Add listeners.\n *\n * just a wrapper for various snippets that add listeners\n */\n var addListeners = function() {\n var selectors = [\n '.chapters a',\n '.section_footer a',\n ' #toc-search-results a'\n ];\n\n $(document).on('click', selectors.join(', '), function(e) {\n var href = this.getAttribute('href');\n if (window.history && window.history.pushState) {\n history.pushState(null, null, href);\n // Force hashchange fix for FF & IE9.\n $(window).trigger('hashchange');\n // Prevent scrolling to section.\n e.preventDefault();\n } else {\n location.hash = href;\n }\n });\n\n // Show fixed header on scroll down\n // using headroom js - http://wicky.nillia.ms/headroom.js/\n var myElement = document.querySelector(\"#mr-nav\");\n // Functions added to trigger on pin and unpin actions for the nav bar\n var onPin = () => {\n $('.snap-drawer-no-headroom').addClass('snap-drawer-headroom');\n $('.snap-drawer-headroom').removeClass('snap-drawer-no-headroom');\n };\n var onUnpin = () => {\n $('.snap-drawer-headroom').addClass('snap-drawer-no-headroom');\n $('.snap-drawer-no-headroom').removeClass('snap-drawer-headroom');\n };\n // Construct an instance of Headroom, passing the element.\n var headroom = new Headroom(myElement, {\n \"tolerance\": 5,\n \"offset\": 100,\n \"classes\": {\n // When element is initialised\n initial: \"headroom\",\n // When scrolling up\n pinned: \"headroom--pinned\",\n // When scrolling down\n unpinned: \"headroom--unpinned\",\n // When above offset\n top: \"headroom--top\",\n // When below offset\n notTop: \"headroom--not-top\"\n },\n \"onPin\": onPin,\n \"onUnpin\": onUnpin\n });\n // When not signed in always show mr-nav?\n if (!$('.notloggedin').length) {\n headroom.init();\n }\n\n // Listener for toc search.\n var dataList = $(\"#toc-searchables\").find('li').clone(true);\n $('#course-toc').on('keyup', '#toc-search-input', function() {\n tocSearchCourse(dataList);\n });\n\n // Handle keyboard navigation of search items.\n $('#course-toc').on('keydown', '#toc-search-input', function(e) {\n var keyCode = e.keyCode || e.which;\n if (keyCode === 9) {\n // 9 tab\n // 13 enter\n // 40 down arrow\n // Register listener for exiting search result.\n $('#toc-search-results a').last().blur(function() {\n $(this).off('blur'); // Unregister listener\n $(\"#toc-search-input\").val('');\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n });\n\n }\n });\n\n $('#course-toc').on(\"click\", '#toc-search-results a', function() {\n $(\"#toc-search-input\").val('');\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n });\n\n /**\n * When the document is clicked, if the closest object that was clicked was not the search input then close\n * the search results.\n * Note that this is triggered also when you click on a search result as the results should no longer be\n * required at that point.\n */\n $(document).on('click', function(event) {\n if (!$(event.target).closest('#toc-search-input').length) {\n $(\"#toc-search-input\").val('');\n $('#toc-search-results').html('');\n $(\"#toc-search-input\").removeClass('state-active');\n }\n });\n\n // Onclick for toggle of state-visible of admin block and mobile menu.\n $(document).on(\"click\", \"#admin-menu-trigger, #toc-mobile-menu-toggle\", function(e) {\n var href = this.getAttribute('href');\n // Make this only happen for settings button.\n if (this.getAttribute('id') === 'admin-menu-trigger') {\n $(this).toggleClass('active');\n $('#page').toggleClass('offcanvas');\n }\n $(href).attr('tabindex', '0');\n $(href).toggleClass('state-visible').focus();\n e.preventDefault();\n\n if ($('.message-app.main').length === 0) {\n document.dispatchEvent(new Event(\"messages-drawer:toggle\"));\n }\n });\n\n // Mobile menu button.\n $(document).on(\"click\", \"#course-toc.state-visible a\", function() {\n $('#course-toc').removeClass('state-visible');\n });\n\n // Reset videos, when changing section (INT-18208).\n $(document).on(\"click\", \".section_footer a, .chapter-title, .toc-footer a\", function() {\n const videos = $('[title=\"watch\"], .video-js, iframe:not([id])');\n for (let i = 0; i < videos.length; i++) {\n if (videos[i].classList.contains('video-js')) {\n if (videos[i].classList.contains('vjs-playing')) {\n let videoButton = videos[i].querySelector('.vjs-play-control.vjs-control.vjs-button');\n videoButton.click(); // Stop for videos using video-js Plugin.\n }\n } else if (videos[i].nodeName === 'IFRAME') {\n if (videos[i].src.includes(\"vimeo\")) {\n videos[i].src += \"\"; // Stop for Vimeo embedded videos.\n }\n } else {\n videos[i].querySelector('iframe').src += \"\"; // Stop for Youtube embedded videos.\n }\n }\n });\n\n $(document).on('click', '.news-article .toggle', function(e) {\n var $news = $(this).closest('.news-article');\n var $newstoggle = $(this);\n var $newsclose = $news.find('.news-article-message > div > a[role=\"button\"]');\n util.scrollToElement($news);\n $('.news-article').not($news).removeClass('state-expanded');\n $('.news-article .toggle').not($newstoggle).attr('aria-expanded', 'false');\n $('.news-article-message > div > a[role=\"button\"]').not($newsclose).attr('aria-expanded', 'false');\n $('.news-article-message').css('display', 'none');\n\n $news.toggleClass('state-expanded');\n if (!$news.attr('state-expanded')) {\n $news.focus();\n $newstoggle.attr('aria-expanded', 'false');\n $newsclose.attr('aria-expanded', 'false');\n }\n $('.state-expanded').find('.news-article-message').slideDown(\"fast\", function() {\n // Animation complete.\n if ($news.is('.state-expanded')) {\n $news.find('.news-article-message').focus();\n $newstoggle.attr('aria-expanded', 'true');\n $newsclose.attr('aria-expanded', 'true');\n } else {\n $news.focus();\n $newstoggle.attr('aria-expanded', 'false');\n $newsclose.attr('aria-expanded', 'false');\n }\n $(document).trigger('snapContentRevealed');\n });\n e.preventDefault();\n });\n\n // Add listeners for pausing animated images.\n $(document).on('click', '.anim-play-button', function() {\n $(this).parent().prev().css('visibility', 'visible');\n });\n $(document).on('click', '.anim-pause-button', function() {\n $(this).parent().prev().css('visibility', 'hidden');\n });\n\n // Initialise the scroll event listener.\n (new Scroll()).init();\n\n // Bootstrap js elements.\n\n // Initialise core bootstrap tooltip js.\n $(function() {\n var supportsTouch = false;\n if ('ontouchstart' in window) {\n // IOS & android\n supportsTouch = true;\n } else if (window.navigator.msPointerEnabled) {\n // Win8\n supportsTouch = true;\n }\n if (!supportsTouch) {\n var tooltipNode = $('[data-toggle=\"tooltip\"]');\n if ($.isFunction(tooltipNode.tooltip)) {\n tooltipNode.tooltip();\n }\n }\n });\n };\n\n /**\n * Function to fix the styles when fullscreen is used with Atto Editor.\n */\n function waitForFullScreenButton() {\n var maxIterations = 15;\n var i = 0;\n var checker = setInterval(function() {\n i = i + 1;\n if (i > maxIterations) {\n clearInterval(checker);\n } else {\n if ($('button.atto_fullscreen_button').length != 0 && $('div.editor_atto').length != 0) {\n $('button.atto_fullscreen_button').click(function() {\n $('div.editor_atto').css('background-color', '#eee');\n $('div.editor_atto').css('z-index', '1');\n });\n $('button.atto_html_button').click(function() {\n $('#id_introeditor').css('z-index', '1');\n });\n clearInterval(checker);\n }\n }\n }, 2000);\n }\n\n /**\n * AMD return object.\n */\n return {\n /**\n * Snap initialise function.\n * @param {object} courseConfig\n * @param {bool} pageHasCourseContent\n * @param {int} siteMaxBytes\n * @param {bool} forcePassChange\n * @param {bool} messageBadgeCountEnabled\n * @param {int} userId\n * @param {bool} sitePolicyAcceptReqd\n * @param {bool} inAlternativeRole\n * @param {string} brandColors\n * @param {int} gradingConstants\n */\n snapInit: function(courseConfig, pageHasCourseContent, siteMaxBytes, forcePassChange,\n messageBadgeCountEnabled, userId, sitePolicyAcceptReqd, inAlternativeRole,\n brandColors, gradingConstants) {\n\n // Set up.\n\n // Branding colors. New colors can be set up if necessary.\n brandColorSuccess = brandColors.success;\n brandColorWarning = brandColors.warning;\n // Grading constants for percentage.\n GRADE_DISPLAY_TYPE_PERCENTAGE = gradingConstants.gradepercentage;\n GRADE_DISPLAY_TYPE_PERCENTAGE_REAL = gradingConstants.gradepercentagereal;\n GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER = gradingConstants.gradepercentageletter;\n GRADE_DISPLAY_TYPE_REAL = gradingConstants.gradereal;\n GRADE_DISPLAY_TYPE_REAL_PERCENTAGE = gradingConstants.graderealpercentage;\n GRADE_DISPLAY_TYPE_REAL_LETTER = gradingConstants.graderealletter;\n\n M.cfg.context = courseConfig.contextid;\n M.snapTheme = {forcePassChange: forcePassChange};\n\n // General AMD modules.\n personalMenu.init(sitePolicyAcceptReqd);\n\n // Course related AMD modules (note, site page can technically have course content too).\n if (pageHasCourseContent) {\n require(\n [\n 'theme_snap/course-lazy'\n ], function(CourseLibAmd) {\n // Instantiate course lib.\n var courseLib = new CourseLibAmd(courseConfig);\n\n // Hash change listener goes here because it requires courseLib.\n listenHashChange(courseLib);\n }\n );\n }\n\n // When document has loaded.\n /* eslint-disable complexity */\n $(document).ready(function() {\n movePHPErrorsToHeader(); // Boring\n setForumStrings(); // Whatever\n addListeners(); // Essential\n applyBlockHash(); // Change location hash if necessary\n bodyClasses(); // Add body classes\n mobileFormChecker();\n util.processAnimatedImages();\n\n // Make sure that the blocks are always within page-content for assig view page.\n $('#page-mod-assign-view #page-content').append($('#moodle-blocks'));\n\n // Append resource card fadeout to content resource card.\n $('.snap-resource-long .contentafterlink .snap-resource-card-fadeout').each(function() {\n $(this).appendTo($(this).prevAll('.snap-resource-long .contentafterlink .no-overflow'));\n });\n\n // Remove from Dom the completion tracking when it is disabled for an activity.\n $('.snap-header-card .snap-header-card-icons .disabled-snap-asset-completion-tracking').remove();\n\n // Prepend asset type when activity is a folder to appear in the card header instead of the content.\n var folders = $('li.snap-activity.modtype_folder');\n $.each(folders, function(index, folder) {\n var content = $(folder).find('div.contentwithoutlink div.snap-assettype');\n if (content.length > 0) {\n if ($(folder).find('div.activityinstance div.snap-header-card .asset-type').length == 0) {\n var folderAssetTypeHeader = $(folder).find('div.activityinstance div.snap-header-card');\n content.prependTo(folderAssetTypeHeader);\n }\n }\n });\n\n // Add a class to the body to show js is loaded.\n $('body').addClass('snap-js-loaded');\n // Apply progressbar.js for circluar progress display.\n progressbarcircle();\n // Course footer recent updates dom fixes.\n recentUpdatesFix();\n\n if ($('body').hasClass('pagelayout-course') || $('body').hasClass('pagelayout-frontpage')) {\n coverImage.courseImage(courseConfig.shortname, siteMaxBytes);\n } else if ($('body').hasClass('pagelayout-coursecategory')) {\n if (courseConfig.categoryid) {\n coverImage.categoryImage(courseConfig.categoryid, siteMaxBytes);\n }\n }\n\n // Allow deeplinking to bs tabs on snap settings page.\n if ($('#page-admin-setting-themesettingsnap').length) {\n var tabHash = location.hash;\n // Check link is to a tab hash.\n if (tabHash && $('.nav-link[href=\"' + tabHash + '\"]').length) {\n $('.nav-link[href=\"' + tabHash + '\"]').tab('show');\n $(window).scrollTop(0);\n }\n\n // Hide advanced feeds additional life time setting when advanced feeds are disabled.\n var changeNodeVisibilityOnChecked = function(selectorToCheck, selectorToChange) {\n var nodeToCheck = $(selectorToCheck),\nnodeToChange = $(selectorToChange);\n if (nodeToCheck.is(':checked')) {\n nodeToChange.show();\n return;\n }\n nodeToChange.hide();\n };\n var advFeedsCheckboxSelector = '#id_s_theme_snap_personalmenuadvancedfeedsenable';\n var advFeedsLifeTimeSelector = '#admin-personalmenuadvancedfeedslifetime';\n changeNodeVisibilityOnChecked(advFeedsCheckboxSelector, advFeedsLifeTimeSelector);\n $(advFeedsCheckboxSelector).on('click', function() {\n changeNodeVisibilityOnChecked(advFeedsCheckboxSelector, advFeedsLifeTimeSelector);\n });\n }\n\n // Add extra padding when the error validation message appears at the moment of enter a not valid\n // URL for feature spots.\n var firstlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_one_title_link span.error');\n var secondlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_two_title_link span.error');\n var thirdlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_three_title_link span.error');\n var titlelinksettingone = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_one_title_link .form-label');\n var titlelinksettingtwo = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_two_title_link .form-label');\n var titlelinksettingthree = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +\n ' #admin-fs_three_title_link .form-label');\n // Create an extra Div to wrap title links settings to avoid line break.\n $('#page-admin-setting-themesettingsnap #themesnapfeaturespots ' +\n '#admin-fs_three_title').nextUntil('#page-admin-setting-themesettingsnap #themesnapfeaturespots ' +\n '#admin-fs_one_title_link_cb').wrapAll(\"\");\n var linktitlestyle = {'padding-bottom': '2.1em'};\n\n // We need to modify the padding of these elements depending on the case, because when validating\n // the link and throwing an error, this will create an extra height to the parent and can break\n // the visualization of the settings page for Feature spots.\n if ((firstlinkerror).length) {\n titlelinksettingtwo.css(linktitlestyle);\n titlelinksettingthree.css(linktitlestyle);\n }\n if ((secondlinkerror).length) {\n titlelinksettingone.css(linktitlestyle);\n titlelinksettingthree.css(linktitlestyle);\n }\n if ((thirdlinkerror).length) {\n titlelinksettingone.css(linktitlestyle);\n titlelinksettingtwo.css(linktitlestyle);\n }\n\n if ($('body').hasClass('snap-pm-open')) {\n personalMenu.update();\n }\n\n // SHAME - make section name creation mandatory\n if ($('#page-course-editsection.format-topics').length) {\n var usedefaultname = document.getElementById('id_name_customize'),\n sname = document.getElementById('id_name_value');\n usedefaultname.value = '1';\n usedefaultname.checked = true;\n sname.required = \"required\";\n // Make sure that section does have at least one character.\n $(sname).attr(\"pattern\", \".*\\\\S+.*\");\n $(usedefaultname).parent().css('display', 'none');\n\n // Enable the cancel button.\n $('#id_cancel').on('click', function() {\n $(sname).removeAttr('required');\n $(sname).removeAttr('pattern');\n return true;\n });\n // Make sure that in other formats, \"only spaces\" name is not available.\n } else {\n $('#id_name_value').attr(\"pattern\", \".*\\\\S+.*\");\n $('#id_cancel').on('click', function() {\n $(sname).removeAttr('pattern');\n return true;\n });\n }\n\n // Book mod print button, only show if print link already present.\n if ($('#page-mod-book-view a[href*=\"mod/book/tool/print/index.php\"]').length) {\n var urlParams = getURLParams(location.href);\n if (urlParams) {\n $('[data-block=\"_fake\"]').append('

' +\n '


' +\n M.util.get_string('printbook', 'booktool_print') +\n '

');\n }\n }\n\n var modSettingsIdRe = /^page-mod-.*-mod$/; // E.g. #page-mod-resource-mod or #page-mod-forum-mod\n var onModSettings = modSettingsIdRe.test($('body').attr('id')) && location.href.indexOf(\"modedit\") > -1;\n if (!onModSettings) {\n modSettingsIdRe = /^page-mod-.*-general$/;\n onModSettings = modSettingsIdRe.test($('body').attr('id')) && location.href.indexOf(\"modedit\") > -1;\n }\n var onCourseSettings = $('body').attr('id') === 'page-course-edit';\n var onSectionSettings = $('body').attr('id') === 'page-course-editsection';\n $('#page-mod-hvp-mod .h5p-editor-iframe').parent().css({\"display\": \"block\"});\n var pageBlacklist = ['page-mod-hvp-mod'];\n var pageNotInBlacklist = pageBlacklist.indexOf($('body').attr('id')) === -1;\n\n if ((onModSettings || onCourseSettings || onSectionSettings) && pageNotInBlacklist) {\n // Wrap advanced options in a div\n var vital = [\n ':first',\n '#page-course-edit #id_descriptionhdr',\n '#id_contentsection',\n '#id_general + #id_general', // Turnitin duplicate ID bug.\n '#id_content',\n '#page-mod-choice-mod #id_optionhdr',\n '#page-mod-workshop-mod #id_gradingsettings',\n '#page-mod-choicegroup-mod #id_miscellaneoussettingshdr',\n '#page-mod-choicegroup-mod #id_groups',\n '#page-mod-scorm-mod #id_packagehdr'\n ];\n vital = vital.join();\n\n $('form[id^=\"mform1\"] > fieldset').not(vital).wrapAll('
');\n\n // Add expand all to advanced column.\n $(\".snap-form-advanced\").append($(\".collapsible-actions\"));\n // Add collapsed to all fieldsets in advanced, except on course edit page.\n if (!$('#page-course-edit').length) {\n $(\".snap-form-advanced fieldset\").addClass('collapsed');\n }\n\n // Sanitize required input into a single fieldset\n var mainForm = $('form[id^=\"mform1\"] fieldset:first');\n var appendTo = $('form[id^=\"mform1\"] fieldset:first .fcontainer');\n\n var required = $('form[id^=\"mform1\"] > fieldset').not('form[id^=\"mform1\"] > fieldset:first');\n for (var i = 0; i < required.length; i++) {\n var content = $(required[i]).find('.fcontainer');\n $(appendTo).append(content);\n $(required[i]).remove();\n }\n $(mainForm).wrap('
');\n\n // Show the form buttons when adding multiple LTI activities.\n if ($('body#page-mod-lti-mod').length) {\n var multipleLTIActivities =\n document.querySelector('section#region-main form.mform > div[data-attribute=\"dynamic-import\"]');\n var LTIObserver = new MutationObserver(function() {\n $('fieldset#id_general > :nth-child(5)').detach()\n .appendTo('section#region-main > div[role=\"main\"] > form.mform');\n });\n var LTIObserverConfig = {childList: true};\n LTIObserver.observe(multipleLTIActivities, LTIObserverConfig);\n }\n\n var description = $('form[id^=\"mform1\"] fieldset:first .fitem_feditor:not(.required)');\n\n if (onModSettings && description) {\n var noNeedDescSelectors = [\n 'body#page-mod-assign-mod',\n 'body#page-mod-choice-mod',\n 'body#page-mod-turnitintool-mod',\n 'body#page-mod-workshop-mod',\n ];\n var addMultiMessageSelectors = [\n 'body#page-mod-url-mod',\n 'body#page-mod-resource-mod',\n 'body#page-mod-folder-mod',\n 'body#page-mod-imscp-mod',\n 'body#page-mod-lightboxgallery-mod',\n 'body#page-mod-scorm-mod',\n ];\n if ($(noNeedDescSelectors.join()).length === 0) {\n $(appendTo).append(description);\n $(appendTo).append($('#fitem_id_showdescription'));\n }\n // Resource cards - add a message to this type of activities, these activities will not display\n // any multimedia.\n if ($(addMultiMessageSelectors.join()).length > 0) {\n str.get_strings([\n {key: 'multimediacard', component: 'theme_snap'}\n ]).done(function(stringsjs) {\n var activityCards = stringsjs[0];\n var cardmultimedia = $(\"[id='id_showdescription']\").closest('.form-group');\n $(cardmultimedia).append(activityCards);\n });\n }\n }\n\n // Resources - put description in common mod settings.\n description = $(\"#page-mod-resource-mod [data-fieldtype='editor']\").closest('.form-group');\n var showdescription = $(\"#page-mod-resource-mod [id='id_showdescription']\").closest('.form-group');\n $(\"#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer\").append(description);\n $(\"#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer\").append(showdescription);\n\n // Assignment - put due date in required.\n var duedate = $(\"#page-mod-assign-mod [for='id_duedate']\").closest('.form-group');\n $(\"#page-mod-assign-mod .snap-form-required .fcontainer\").append(duedate);\n\n // Move availablity at the top of advanced settings.\n var availablity = $('#id_visible').closest('.form-group').addClass('snap-form-visibility');\n var label = $(availablity).find('label');\n var select = $(availablity).find('select');\n $(label).insertBefore(select);\n\n // SHAME - rewrite visibility form lang string to be more user friendly.\n $(label).text(M.util.get_string('visibility', 'theme_snap') + ' ');\n\n if ($(\"#page-course-edit\").length) {\n // We are in course editing form.\n // Removing the \"Show all sections in one page\" from the course format form.\n var strDisabled = \"\";\n (function() {\n return str.get_strings([\n {key: 'showallsectionsdisabled', component: 'theme_snap'},\n {key: 'disabled', component: 'theme_snap'}\n ]);\n })()\n .then(function(strings) {\n var strMessage = strings[0];\n strDisabled = strings[1];\n return templates.render('theme_snap/form_alert', {\n type: 'warning',\n classes: '',\n message: strMessage\n });\n })\n .then(function(html) {\n var op0 = $('[name=\"coursedisplay\"] > option[value=\"0\"]');\n var op1 = $('[name=\"coursedisplay\"] > option[value=\"1\"]');\n var selectNode = $('[name=\"coursedisplay\"]');\n // Disable option 0\n op0.attr('disabled', 'disabled');\n // Add \"(Disabled)\" to option text\n op0.append(' (' + strDisabled + ')');\n // Remove selection attribute\n op0.removeAttr(\"selected\");\n // Select option 1\n op1.attr('selected', 'selected');\n // Add warning\n selectNode.parent().append(html);\n });\n }\n\n $('.snap-form-advanced').prepend(availablity);\n\n // Add save buttons.\n var savebuttons = $('form[id^=\"mform1\"] > .form-group:last');\n $(mainForm).append(savebuttons);\n\n // Expand collapsed fieldsets when editing a mod that has errors in it.\n var errorElements = $('.form-group.has-danger');\n if (onModSettings && errorElements.length) {\n errorElements.closest('.collapsible').removeClass('collapsed');\n }\n\n // Hide appearance menu from interface when editing a page-resource.\n if ($(\"#page-mod-page-mod\").length) {\n // Chaining promises to get localized strings and render warning message.\n (function() {\n return str.get_strings([\n {key: 'showappearancedisabled', component: 'theme_snap'}\n ]);\n })()\n .then(function(localizedstring) {\n return templates.render('theme_snap/form_alert', {\n type: 'warning',\n classes: '',\n message: localizedstring\n });\n })\n // eslint-disable-next-line promise/always-return\n .then(function(html) {\n // Disable checkboxes.\n // Colors for disabling the divs.\n var layoverbkcolor = \"#f1f1f1\";\n var layovercolor = \"#d5d5d5\";\n var pageInputs = $('[id=\"id_printheading\"], [id=\"id_printintro\"],' +\n ' [id=\"id_printlastmodified\"], [id=\"id_display\"],' +\n ' [id=\"id_popupwidth\"], [id=\"id_popupheight\"]');\n\n // This will help with disable the multiple options for the select, and let the one by default.\n // Allowing to submit the form.\n $('#id_display option:not(:selected)').attr('disabled', true);\n\n // Note we can't use 'disabled' for settings or they don't get submitted.\n pageInputs.attr('readonly', true);\n $('#id_display').attr('disabled', true);\n pageInputs.attr('tabindex', -1); // Prevent tabbing to change val.\n pageInputs.click(function(e) {\n e.preventDefault();\n return false;\n });\n pageInputs.parent().parent().parent().css('background-color', layoverbkcolor);\n pageInputs.parent().parent().parent().css('color', layovercolor);\n\n // Add warning.\n var selectNode = $('#id_appearancehdrcontainer');\n selectNode.append(html);\n });\n $('#id_showdescription').parent().parent().parent().hide();\n }\n }\n // Remove disabled attribute for section name for topics format.\n if (onSectionSettings) {\n var sectionName = $(\"#page-course-editsection.format-topics .form-group #id_name_value\");\n if (sectionName.length) {\n let sectionNameIsDiabled = document.getElementById('id_name_value').hasAttribute(\"disabled\");\n if (sectionNameIsDiabled) {\n document.getElementById('id_name_value').removeAttribute(\"disabled\");\n }\n }\n }\n\n // Conversation counter for user badge.\n if (messageBadgeCountEnabled) {\n require(\n [\n 'theme_snap/conversation_badge_count-lazy'\n ], function(conversationBadgeCount) {\n conversationBadgeCount.init(userId);\n }\n );\n }\n\n // Update Messages badge without reloading the site.\n $('.message-app .list-group').on('click', '.list-group-item.list-group-item-action', function(e) {\n require(\n [\n 'theme_snap/conversation_badge_count-lazy'\n ], function(conversationBadgeCount) {\n let conversationId = e.currentTarget.attributes['data-conversation-id'].value;\n conversationBadgeCount.init(userId, conversationId);\n }\n );\n });\n\n // Listen to cover image label key press for accessible usage.\n var focustarget = $('#snap-coverimagecontrol label');\n if (focustarget && focustarget.length) {\n focustarget.keypress(function(e) {\n if (e.which === 13) {\n $('#snap-coverfiles').trigger('click');\n }\n });\n }\n\n // Review if settings block is missing.\n if (!$('.block_settings').length) {\n // Hide admin icon.\n $('#admin-menu-trigger').hide();\n if (inAlternativeRole) {\n // Handle possible alternative role.\n require(\n [\n 'theme_snap/alternative_role_handler-lazy'\n ], function(alternativeRoleHandler) {\n alternativeRoleHandler.init(courseConfig.id);\n }\n );\n }\n }\n\n // Add tab logic order to navigation bar icons, part of this order is being taken from the layout nav.php file.\n var customMenu = $('ul.snap-navbar-content li:first-child a');\n var moodlePage = $(\"#moodle-page a:first\");\n var notificationsBtn = $('#nav-notification-popover-container > div.popover-region-toggle.nav-link');\n var searchButton = $('#mr-nav .simplesearchform a.btn.btn-open');\n var adminMenuTrigger = $('#admin-menu-trigger');\n\n var lastElement;\n if (customMenu.length) {\n lastElement = customMenu;\n } else {\n lastElement = moodlePage;\n }\n if (notificationsBtn.length && searchButton.length && adminMenuTrigger.length && lastElement.length) {\n // Update tab events because all elements have tabindex=\"0\" and they are rendered funny.\n require(\n [\n 'theme_snap/rearrange_tab_handler-lazy'\n ], function(searchTabHandler) {\n searchTabHandler.init([notificationsBtn, searchButton, adminMenuTrigger, lastElement]);\n }\n );\n }\n\n // Add settings tab show behaviour to classes which want to do that.\n $('.snap-settings-tab-link').on('click', function() {\n var tab = $('a[href=\"' + $(this).attr('href') + '\"].nav-link');\n if (tab.length) {\n tab.tab('show');\n }\n });\n\n // Unpin headroom when url has #course-detail-title.\n if (window.location.hash === '#course-detail-title') {\n $('#mr-nav').removeClass('headroom--pinned').addClass('headroom--unpinned');\n }\n\n // Re position submit buttons for forms when using mobile mode at the bottom of the form.\n var savebuttonsformrequired = $('div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem');\n var width = $(window).width();\n if (width < 767) {\n $('.snap-form-advanced').append(savebuttonsformrequired);\n }\n\n // Fix a position for the new 'Send content change notification' setting.\n if ( $('.path-mod.theme-snap #id_coursecontentnotification').length ) {\n const notificationCheck = document.getElementById('id_coursecontentnotification')\n .closest(\".form-group.fitem\");\n const submitButtons = $('.snap-form-required [data-groupname=\"buttonar\"]');\n if (notificationCheck !== null && submitButtons.length) {\n notificationCheck.classList.add('snap_content_notification_check');\n submitButtons.before(notificationCheck);\n }\n }\n\n // Hide Blocks editing on button from the Intelliboard Dashboard page in Snap.\n if ( $('#page-home.theme-snap .intelliboard-page').length && $('.snap-page-heading-button').length) {\n const blocksEditingOnButton = document.getElementsByClassName('snap-page-heading-button')[0];\n blocksEditingOnButton.classList.add(\"hidden\");\n }\n\n // Hide edit button for main page in Grade report single view.\n const editingButton = $('#page-grade-report-singleview-index .grade_report_edit_button');\n if (editingButton.length && !$('.search-widget.dropdown').length) {\n editingButton.addClass(\"hidden\");\n }\n\n // Code for Tiles particular loading, needed before other scripts but after the document is ready.\n var targetTilesSect = document.querySelector('section#tiles-section');\n if (targetTilesSect !== null) {\n var configTilesSect = {childList: true, subtree: true};\n var observerTilesSect = new MutationObserver(function() {\n util.processAnimatedImages();\n });\n observerTilesSect.observe(targetTilesSect, configTilesSect);\n }\n\n waitForFullScreenButton();\n });\n accessibility.snapAxInit();\n messages.init();\n\n // Smooth scroll for go to top button.\n $(\"div#goto-top-link > a\").click(function() {\n window.scrollTo({top: 0, behavior: 'smooth'});\n $('body').find('a, [tabindex=0]').first().focus();\n });\n\n // Blocks selectors to remove 'editing' class because is not necessary to access their settings.\n var noneditingblocks = {};\n noneditingblocks.blockxp = '#page-blocks-xp-index';\n\n // Remove 'editing' class actions.\n for (var block in noneditingblocks) {\n var blockisediting = $(noneditingblocks[block]).hasClass('editing');\n if (blockisediting === true) {\n $(noneditingblocks[block]).removeClass('editing');\n }\n }\n\n // Check Toggle Completion to force redirect to URL.\n const toggleCompletion = '.togglecompletion';\n const delay = 1500;\n $(toggleCompletion).on('submit', function() {\n var shouldReload = $(toggleCompletion).hasClass('forcereload');\n if (shouldReload === true) {\n setTimeout(function() {\n location.reload(true);\n }, delay);\n }\n });\n\n // Inherit transparent background color for divs containing non-default mod_url icons.\n if (!document.body.classList.contains('snap-resource-card')) { // Only for Snap Resource display List.\n document.querySelectorAll('.activityiconcontainer.url').forEach(urlDiv => {\n if (urlDiv.querySelector('img[src*=\"/theme/image.php/snap/core/\"][src*=\"/f/\"]')) {\n urlDiv.style.backgroundColor = 'inherit';\n }\n });\n }\n\n }\n };\n }\n);\n"],"names":["define","$","log","Headroom","util","personalMenu","coverImage","ProgressBar","templates","str","accessibility","messages","Scroll","M","theme_snap","disableAll","brandColorSuccess","brandColorWarning","GRADE_DISPLAY_TYPE_PERCENTAGE","GRADE_DISPLAY_TYPE_PERCENTAGE_REAL","GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER","GRADE_DISPLAY_TYPE_REAL","GRADE_DISPLAY_TYPE_REAL_PERCENTAGE","GRADE_DISPLAY_TYPE_REAL_LETTER","getURLParams","href","ta","split","length","urlparams","items","params","i","item","key","val","window","on","mobileFormChecker","updateGraderHeadersTop","savebuttonsformrequired","savebuttonsformadvanced","width","append","graderHeader","css","height","regionMain","querySelector","addClass","onCoursePage","attr","indexOf","processSearchString","searchString","trim","toLowerCase","createColoredDataCircle","nodePointer","dataCallback","valueCallback","circle","Circle","color","easing","strokeWidth","trailWidth","duration","text","value","endColor","setText","valueAnimate","animate","from","to","step","state","path","setAttribute","addListeners","document","join","e","this","getAttribute","history","pushState","trigger","preventDefault","location","hash","myElement","headroom","initial","pinned","unpinned","top","notTop","removeClass","init","dataList","find","clone","ua","navigator","userAgent","html","matches","dataItem","push","tocSearchCourse","keyCode","which","last","blur","off","event","target","closest","toggleClass","focus","dispatchEvent","Event","videos","classList","contains","click","nodeName","src","includes","$news","$newstoggle","$newsclose","scrollToElement","not","slideDown","is","parent","prev","supportsTouch","msPointerEnabled","tooltipNode","isFunction","tooltip","snapInit","courseConfig","pageHasCourseContent","siteMaxBytes","forcePassChange","messageBadgeCountEnabled","userId","sitePolicyAcceptReqd","inAlternativeRole","brandColors","gradingConstants","success","warning","gradepercentage","gradepercentagereal","gradepercentageletter","gradereal","graderealpercentage","graderealletter","cfg","context","contextid","snapTheme","require","CourseLibAmd","courseLib","lastHash","newHash","info","update","showSection","listenHashChange","ready","extraclasses","xdebugs","x","fontel","parentNode","br","remove","msgs","errorcont","get_string","after","errorlink","movePHPErrorsToHeader","each","urlParams","time","formselectors","paramchecks","p","formurl","applyBlockHash","processAnimatedImages","appendTo","prevAll","folders","index","folder","content","folderAssetTypeHeader","prependTo","nodeValue","gradeFormat","hasClass","courseImage","shortname","categoryid","categoryImage","tabHash","tab","scrollTop","changeNodeVisibilityOnChecked","selectorToCheck","selectorToChange","nodeToCheck","nodeToChange","show","hide","advFeedsCheckboxSelector","firstlinkerror","secondlinkerror","thirdlinkerror","titlelinksettingone","titlelinksettingtwo","titlelinksettingthree","nextUntil","wrapAll","linktitlestyle","usedefaultname","getElementById","sname","checked","required","removeAttr","id","modSettingsIdRe","onModSettings","test","onCourseSettings","onSectionSettings","pageNotInBlacklist","vital","mainForm","wrap","multipleLTIActivities","MutationObserver","detach","observe","childList","description","get_strings","component","done","stringsjs","activityCards","cardmultimedia","showdescription","duedate","availablity","label","select","insertBefore","strDisabled","then","strings","strMessage","render","type","classes","message","op0","op1","selectNode","prepend","savebuttons","errorElements","localizedstring","pageInputs","hasAttribute","removeAttribute","conversationBadgeCount","conversationId","currentTarget","attributes","focustarget","keypress","alternativeRoleHandler","lastElement","customMenu","moodlePage","notificationsBtn","searchButton","adminMenuTrigger","searchTabHandler","notificationCheck","submitButtons","add","before","getElementsByClassName","editingButton","targetTilesSect","subtree","checker","setInterval","clearInterval","waitForFullScreenButton","snapAxInit","scrollTo","behavior","first","noneditingblocks","block","setTimeout","reload","body","querySelectorAll","forEach","urlDiv","style","backgroundColor"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BAA,yBAAO,CAAC,SAAU,WAAY,sBAAuB,kBAAmB,2BAChE,yBAA0B,yBAA0B,iBAAkB,WAAY,2BAClF,sBAAuB,sBAC3B,SAASC,EAAGC,IAAKC,SAAUC,KAAMC,aAAcC,WAAYC,YAAaC,UAAWC,IAAKC,cAAeC,SAAUC,QAK7GC,EAAEC,WAAaD,EAAEC,YAAc,GAU3BZ,IAAIa,YAAW,OAWfC,kBAAoB,GACpBC,kBAAoB,GACpBC,8BAAgC,GAChCC,mCAAqC,GACrCC,qCAAuC,GACvCC,wBAA0B,GAC1BC,mCAAqC,GACrCC,+BAAi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,QAAQqD,gBAJJ,CAACpD,WAAW,EAAMqD,SAAS,oBAvjBzDpR,EAAI,EACJqR,QAAUC,aAAY,YACtBtR,GAAQ,GAHQ,GAKZuR,cAAcF,SAEmC,GAA7CpT,EAAE,iCAAiC2B,QAA8C,GAA/B3B,EAAE,mBAAmB2B,SACvE3B,EAAE,iCAAiC8H,OAAM,WACrC9H,EAAE,mBAAmB4C,IAAI,mBAAoB,QAC7C5C,EAAE,mBAAmB4C,IAAI,UAAW,QAExC5C,EAAE,2BAA2B8H,OAAM,WAC/B9H,EAAE,mBAAmB4C,IAAI,UAAW,QAExC0Q,cAAcF,YAGvB,KA6iBKG,MAEJ9S,cAAc+S,aACd9S,SAASyF,OAGTnG,EAAE,yBAAyB8H,OAAM,WAC7B3F,OAAOsR,SAAS,CAACzN,IAAK,EAAG0N,SAAU,WACnC1T,EAAE,QAAQqG,KAAK,mBAAmBsN,QAAQnM,eAI1CoM,iBAAmB,CACvBA,QAA2B,6BAGtB,IAAIC,SAASD,iBAAkB,EAET,IADF5T,EAAE4T,iBAAiBC,QAAQ5G,SAAS,YAErDjN,EAAE4T,iBAAiBC,QAAQ3N,YAAY,WAO/ClG,EAFyB,qBAELoC,GAAG,UAAU,YAER,IADFpC,EAHE,qBAGkBiN,SAAS,gBAE5C6G,YAAW,WACPrO,SAASsO,QAAO,KALd,SAWT/O,SAASgP,KAAKpM,UAAUC,SAAS,uBAClC7C,SAASiP,iBAAiB,8BAA8BC,SAAQC,SACxDA,OAAOpR,cAAc,yDACrBoR,OAAOC,MAAMC,gBAAkB"} \ No newline at end of file diff --git a/theme/snap/amd/src/snap.js b/theme/snap/amd/src/snap.js index f9c504ac27dc2..9365b37246ed6 100644 --- a/theme/snap/amd/src/snap.js +++ b/theme/snap/amd/src/snap.js @@ -1219,11 +1219,13 @@ nodeToChange = $(selectorToChange); // Code for Tiles particular loading, needed before other scripts but after the document is ready. var targetTilesSect = document.querySelector('section#tiles-section'); - var configTilesSect = {childList: true, subtree: true}; - var observerTilesSect = new MutationObserver(function() { - util.processAnimatedImages(); - }); - observerTilesSect.observe(targetTilesSect, configTilesSect); + if (targetTilesSect !== null) { + var configTilesSect = {childList: true, subtree: true}; + var observerTilesSect = new MutationObserver(function() { + util.processAnimatedImages(); + }); + observerTilesSect.observe(targetTilesSect, configTilesSect); + } waitForFullScreenButton(); });