1 2/** 3 * JS for the header 4 * 5 * @package theme_boosticeo 6 * @copyright 2022 oct Eticeo <[email protected]> 7 * @author 2022 oct Guevara Gabrielle <[email protected]> 8 * @author 2022 oct Carre Jeremy <[email protected]> 9 * @author 2025 feb Laureen Belgrand <[email protected]> 10 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 11 */ 12$(function(){if($('.block.block_navigation').length>0&&$('.user_settings_menu.eticeo-dropdown-menu').length>0){const $firstBlockNavigation=$('.block.block_navigation').first();$('.block.block_navigation').not($firstBlockNavigation).remove();$('.user_settings_menu.eticeo-dropdown-menu').append($firstBlockNavigation);$('.eticeo-dropdown-menu .block.block_navigation .card-body h5').prepend('<i class="ph ph-tree-structure"></i>')}else{$('.block.block_navigation').hide()} 13if($('.block.block_settings').length>0&&$('.user_settings_menu.eticeo-dropdown-menu').length>0){$('.user_settings_menu.eticeo-dropdown-menu a[href$="search.php"]').hide();const $firstBlockSettings=$('.block.block_settings').first();$('.block.block_settings').not($firstBlockSettings).remove();$('.user_settings_menu.eticeo-dropdown-menu').append($firstBlockSettings);$('.user_settings_menu.eticeo-dropdown-menu .block_settings.hidden').removeClass('hidden');$('.user_settings_menu.eticeo-dropdown-menu .block_settings .block_action').hide();$('.eticeo-dropdown-menu .block.block_settings .card-body h3').prepend('<i class="ph ph-gear"></i>')}else if($('.block.block_settings').length>0){$('.block.block_settings').hide()} 14if($('.block.block_adminblock').length>0&&$('.user_settings_menu.eticeo-dropdown-menu').length>0){const $firstBlockAdminblock=$('.block.block_adminblock').first();$('.block.block_adminblock').not($firstBlockAdminblock).remove();$('.user_settings_menu.eticeo-dropdown-menu').append($firstBlockAdminblock)}else{$('.block.block_adminblock').hide()} 15if($('.add_block_button').length>0&&$('.user_settings_menu.eticeo-dropdown-menu').length>0){const $firstAddBlockButton=$('.add_block_button').first();$('.add_block_button').not($firstAddBlockButton).remove();$('.user_settings_menu.eticeo-dropdown-menu').append($firstAddBlockButton)} 16$('#eticeo_header .admin-toggle').on('click',function(event){event.stopPropagation();let targetId=$(this).data('target');let $target=$('#'+targetId);if($target.is(':visible')){$target.hide()}else{$target.attr('style','display:flex;')} 17let $adminsiteToggle=$('#settingsnav li.type_siteadmin');if($adminsiteToggle.length>0&&$adminsiteToggle.is(':first-child')){$adminsiteToggle.click()}});$(document).on('click',function(event){let $target=$('#'+$('#eticeo_header .admin-toggle').data('target'));if(!$target.is(event.target)&&$target.has(event.target).length===0&&!$('#eticeo_header .admin-toggle').is(event.target)){$target.hide()}});$('.eticeo-dropdown-menu>section .card-body h5').on('click',function(){$(this).parent().parent().find('.content').toggle()});$('.eticeo-dropdown-menu>section .card-body h3').on('click',function(){$(this).parent().parent().find('.content').toggle()});$('#eticeo_header .userbutton').on('click',function(){$('#eticeo_header .eticeo-dropdown-menu').hide()});let offset=50;let duration=500;let bttOn;if($("#page").scrollTop()>offset){bttOn=!1}else{bttOn=!0} 18let scrollCheck=function(){if($("#page").scrollTop()>offset){if(bttOn==!1){bttOn=!0;$('#back-to-top').fadeIn(duration)}}else{if(bttOn==!0){bttOn=!1;$('#back-to-top').fadeOut(duration)}}};scrollCheck();$("#page").scroll(function(){scrollCheck()});$('#back-to-top').click(function(event){event.preventDefault();$("#page").animate({scrollTop:0},duration);return!1})});function callUrlByApi(url,refresh,type){$.ajax({type:(type?type:'GET'),url:url,success:function(data){if(refresh){location.reload()}}})} 19window.onload=function(){let iframes=document.querySelectorAll('iframe.h5p-iframe');iframes.forEach(function(iframe){iframe.onload=function(){let iframeDocument=iframe.contentDocument||iframe.contentWindow.document;if(iframeDocument){let styleElement=iframeDocument.createElement('style');styleElement.type='text/css';
19let cssRules=``;styleElement.appendChild(iframeDocument.createTextNode(cssRules));iframeDocument.head.appendChild(styleElement)}}})};jQuery(function(){$('#userETICEO_menu').on('shown.bs.dropdown',function(){const activeCarouselItem=document.querySelector('.carousel-item.active');if(activeCarouselItem){activeCarouselItem.focus();document.querySelectorAll('.carousel-item').forEach(element=>{if(!element.classList.contains('active')){element.style.width=activeCarouselItem.offsetWidth+'px';element.style.height=activeCarouselItem.offsetHeight+'px'}})}})});$(document).ready(function(){$('.profile_tree section').hide();$('.profile_tree section').each(function(){let sectionTitle=$(this).find('h5.lead').text().trim();if(sectionTitle==="Informations détaillées"||sectionTitle==="Protection des données et politiques"){$(this).show()}})});jQuery(document).ready(function(){const $toggleButton=$('.theme-switcher');const $rootElement=$('body');let currentTheme=localStorage.getItem('theme');if(currentTheme==='light'||currentTheme==='dark'){$rootElement.addClass(`theme-${currentTheme}`)}else{currentTheme=$rootElement.hasClass('theme-light')?'light':'dark'} 20updateIcon(currentTheme);$toggleButton.on('click',function(){const newTheme=$rootElement.hasClass('theme-light')?'dark':'light';$rootElement.removeClass('theme-light theme-dark').addClass(`theme-${newTheme}`);localStorage.setItem('theme',newTheme);updateIcon(newTheme)});function updateIcon(theme){$toggleButton.find('i').each(function(){$(this).removeClass('ph-sun ph-moon').addClass(theme==='light'?'ph-moon':'ph-sun')})}});jQuery(function(){$progressbars=$('.format-focus .progress-bar');$progressbars.each(function(){const $percent=$(this).attr('aria-valuenow');if($percent<=25){$(this).addClass('progress-25')}else if($percent<=50){$(this).addClass('progress-50')}else if($percent<=75){$(this).addClass('progress-75')}else{$(this).addClass('progress-100')}})});function handleMenu(){const $menuButton=$('.burger-toggle');const $menu=$('#burger-menu');$menuButton.on('click',function(){if($menu.css('display')==='flex'){$menu.css('display','none')}else{$menu.css('display','flex')}})} 21jQuery(function(){if(window.innerWidth>1200){$('.header-mobile').remove();$('#burger-menu').remove()}else{$('.eticeo-navbar-primary').remove();$('.eticeo-navbar-secondary').remove()} 22handleMenu()});jQuery(function(){const $notificationButton=$('.popover-region-notifications');$notificationButton.on('click',function(){const menuid=$notificationButton.find('.popover-region-toggle').attr('aria-controls');const $notificationMenu=$(`#${menuid}`);if($notificationMenu.css('opacity')==='1'){$notificationMenu.css('opacity','0');$notificationMenu.css('visibility','hidden');$notificationMenu.css('height','0')}else{$notificationMenu.css('opacity','1');$notificationMenu.css('visibility','visible');$notificationMenu.css('height','auto')}})})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.