diff --git a/CHANGES.md b/CHANGES.md index 79911339511..f44b4e83077 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2024-02-18 - Make codechecker happier * 2024-02-17 - Test: Use custom step to check the menus and menu items existence, resolves #365. * 2024-02-12 - Feature: Allow the admin to display activity icons in course content navigation, resolves #16. * 2024-02-11 - Child theme support: Improve namespace of class smartmenu_helper, resolves #494. diff --git a/locallib.php b/locallib.php index fdefe7d9266..718e8270317 100644 --- a/locallib.php +++ b/locallib.php @@ -915,7 +915,7 @@ function theme_boost_union_get_emailbrandinghtmlpreview() { $mail = $OUTPUT->render_from_template('core/email_html', $mailtemplatecontext); // And compose mail preview. - $previewtemplatecontext = ['mail' => $mail, 'type' => 'html', 'monospace' => false]; + $previewtemplatecontext = ['mail' => $mail, 'type' => 'Html', 'monospace' => false]; $preview = $OUTPUT->render_from_template('theme_boost_union/emailpreview', $previewtemplatecontext); return $preview; @@ -946,7 +946,7 @@ function theme_boost_union_get_emailbrandingtextpreview() { $mail = nl2br($OUTPUT->render_from_template('core/email_text', $mailtemplatecontext)); // And compose mail preview. - $previewtemplatecontext = ['mail' => $mail, 'type' => 'text', 'monospace' => true]; + $previewtemplatecontext = ['mail' => $mail, 'type' => 'Text', 'monospace' => true]; $preview = $OUTPUT->render_from_template('theme_boost_union/emailpreview', $previewtemplatecontext); return $preview; diff --git a/templates/core_courseformat/local/courseindex/cm.mustache b/templates/core_courseformat/local/courseindex/cm.mustache index cd44ffbfd4b..22a16ffb714 100644 --- a/templates/core_courseformat/local/courseindex/cm.mustache +++ b/templates/core_courseformat/local/courseindex/cm.mustache @@ -99,20 +99,20 @@ if (document.body.classList.contains('hascourseindexcmicons')) { const observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { let node = mutation.target.childNodes[3]; - if (node.id.startsWith('courseindex-cmicon-cplid-')){ - let completionel = document.getElementById(node.id); + if (node.id.startsWith('courseindex-cmicon-cplid-')) { + let cplel = document.getElementById(node.id); // Set the completion color for the icon based on the completion status. - switch (node.dataset.value){ + switch (node.dataset.value) { case 'NaN': break; case '0': - completionel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-incomplete'); + cplel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-incomplete'); break; case '1': - completionel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-complete'); + cplel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-complete'); break; case '3': - completionel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-fail'); + cplel.closest('.courseindex-cmicon-container').classList.add('courseindex-cmicon-cpl-fail'); break; } } diff --git a/templates/emailpreview.mustache b/templates/emailpreview.mustache index 46697f9630d..68c25620951 100644 --- a/templates/emailpreview.mustache +++ b/templates/emailpreview.mustache @@ -25,7 +25,7 @@ Example context (json): { "mail": "Lorem ipsum", - "type": "html", + "type": "Html", "monospace": false } }} @@ -38,20 +38,20 @@
{{#js}} // Get the host element. - const theme_boost_union_email{{type}}preview_host = document.querySelector('#theme_boost_union-email{{type}}preview-host'); + const themeBoostUnionEmail{{type}}PreviewHost = document.querySelector('#theme_boost_union-email{{type}}preview-host'); // Only if the host element exists on this page. - if (typeof(theme_boost_union_email{{type}}preview_host) != 'undefined' && theme_boost_union_email{{type}}preview_host != null) { + if (typeof (themeBoostUnionEmail{{type}}PreviewHost) != 'undefined' && themeBoostUnionEmail{{type}}PreviewHost !== null) { // If the browser supports Shadow DOM. if (document.body.attachShadow) { // Add the email content within a Shadow DOM. - const theme_boost_union_email{{type}}preview_shadow = theme_boost_union_email{{type}}preview_host.attachShadow({ mode: "open" }); - const theme_boost_union_email{{type}}preview_template = document.getElementById('theme_boost_union-email{{type}}preview-shadow'); - theme_boost_union_email{{type}}preview_shadow.appendChild(theme_boost_union_email{{type}}preview_template.content); + const themeBoostUnionEmail{{type}}PreviewShadow = themeBoostUnionEmail{{type}}PreviewHost.attachShadow({mode: "open"}); + const themeBoostUnionEmail{{type}}PreviewTemplate = document.getElementById('theme_boost_union-email{{type}}preview-shadow'); + themeBoostUnionEmail{{type}}PreviewShadow.appendChild(themeBoostUnionEmail{{type}}PreviewTemplate.content); } else { // Add the email content without Shadow DOM (which will result in style bleeding anyway). - const theme_boost_union_email{{type}}preview_template = document.getElementById('theme_boost_union-email{{type}}preview-shadow'); - theme_boost_union_email{{type}}preview_host.appendChild(theme_boost_union_email{{type}}preview_template.content); + const themeBoostUnionEmail{{type}}PreviewTemplate = document.getElementById('theme_boost_union-email{{type}}preview-shadow'); + themeBoostUnionEmail{{type}}PreviewHost.appendChild(themeBoostUnionEmail{{type}}PreviewTemplate.content); } } {{/js}} diff --git a/templates/localloginform.mustache b/templates/localloginform.mustache index fb73b7d3e18..b4a0c3c906e 100644 --- a/templates/localloginform.mustache +++ b/templates/localloginform.mustache @@ -27,7 +27,7 @@ Example context (json): { "loginurl": "http://localhost/stable_master/login/index.php", - "logintoken": "randomstring", + "logintoken": "randomstring" } }} diff --git a/templates/theme_boost/columns2.mustache b/templates/theme_boost/columns2.mustache index 5759182dbf4..e46e27b370a 100644 --- a/templates/theme_boost/columns2.mustache +++ b/templates/theme_boost/columns2.mustache @@ -125,6 +125,6 @@ M.util.js_pending('theme_boost/loader'); require(['theme_boost/loader', 'theme_boost/drawer'{{#includesmartmenu}}, 'theme_boost_union/smartmenu'{{/includesmartmenu}}], function(Loader, Drawer{{#includesmartmenu}}, SmartMenu{{/includesmartmenu}}) { Drawer.init(); M.util.js_complete('theme_boost/loader'); - {{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}} +{{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}} }); {{/js}} diff --git a/templates/theme_boost/drawers.mustache b/templates/theme_boost/drawers.mustache index 414eb6d0741..8ea398f573a 100644 --- a/templates/theme_boost/drawers.mustache +++ b/templates/theme_boost/drawers.mustache @@ -315,7 +315,7 @@ M.util.js_pending('theme_boost/loader'); require(['theme_boost/loader', 'theme_boost/drawer'{{#regions.offcanvas.hasblocks}},'theme_boost_union/offcanvas'{{/regions.offcanvas.hasblocks}}{{#includesmartmenu}}, 'theme_boost_union/smartmenu'{{/includesmartmenu}}], function(Loader, Drawer{{#regions.offcanvas.hasblocks}},OffCanvas{{/regions.offcanvas.hasblocks}}{{#includesmartmenu}}, SmartMenu{{/includesmartmenu}}) { Drawer.init(); M.util.js_complete('theme_boost/loader'); - {{#regions.offcanvas.hasblocks}}OffCanvas.init();{{/regions.offcanvas.hasblocks}} - {{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}} +{{#regions.offcanvas.hasblocks}}OffCanvas.init();{{/regions.offcanvas.hasblocks}} +{{#includesmartmenu}}SmartMenu.init();{{/includesmartmenu}} }); {{/js}}