123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /*
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
- * This devtool is neither made for production nor for readable output files.
- * It uses "eval()" calls to create a separate source file in the browser devtools.
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
- * or disable the default devtool with "devtool: false".
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
- */
- /******/ (function() { // webpackBootstrap
- /******/ var __webpack_modules__ = ({
- /***/ "./scripts/extlink.js":
- /*!****************************!*\
- !*** ./scripts/extlink.js ***!
- \****************************/
- /***/ (function() {
- eval("{/**\n * @file\n * External links js file.\n */\n\n (function ($, Drupal, drupalSettings) {\n\n 'use strict';\n \n Drupal.extlink = Drupal.extlink || {};\n \n Drupal.extlink.attach = function (context, drupalSettings) {\n if (typeof drupalSettings.data === 'undefined' || !drupalSettings.data.hasOwnProperty('extlink')) {\n return;\n }\n \n // Define the jQuery method (either 'append' or 'prepend') of placing the\n // icon, defaults to 'append'.\n var extIconPlacement = 'append';\n if (drupalSettings.data.extlink.extIconPlacement && drupalSettings.data.extlink.extIconPlacement != '0') {\n extIconPlacement = drupalSettings.data.extlink.extIconPlacement;\n }\n \n // Strip the host name down, removing ports, subdomains, or www.\n var pattern = /^(([^\\/:]+?\\.)*)([^\\.:]{1,})((\\.[a-z0-9]{1,253})*)(:[0-9]{1,5})?$/;\n var host = window.location.host.replace(pattern, '$2$3$6');\n var subdomain = window.location.host.replace(host, '');\n \n // Determine what subdomains are considered internal.\n var subdomains;\n if (drupalSettings.data.extlink.extSubdomains) {\n subdomains = '([^/]*\\\\.)?';\n }\n else if (subdomain === 'www.' || subdomain === '') {\n subdomains = '(www\\\\.)?';\n }\n else {\n subdomains = subdomain.replace('.', '\\\\.');\n }\n \n // Whitelisted domains.\n var whitelistedDomains = false;\n if (drupalSettings.data.extlink.whitelistedDomains) {\n whitelistedDomains = [];\n for (var i = 0; i < drupalSettings.data.extlink.whitelistedDomains.length; i++) {\n whitelistedDomains.push(new RegExp('^https?:\\\\/\\\\/' + drupalSettings.data.extlink.whitelistedDomains[i].replace(/(\\r\\n|\\n|\\r)/gm,'') + '.*$', 'i'));\n }\n }\n \n // Build regular expressions that define an internal link.\n var internal_link = new RegExp('^https?://([^@]*@)?' + subdomains + host, 'i');\n \n // Extra internal link matching.\n var extInclude = false;\n if (drupalSettings.data.extlink.extInclude) {\n extInclude = new RegExp(drupalSettings.data.extlink.extInclude.replace(/\\\\/, '\\\\'), 'i');\n }\n \n // Extra external link matching.\n var extExclude = false;\n if (drupalSettings.data.extlink.extExclude) {\n extExclude = new RegExp(drupalSettings.data.extlink.extExclude.replace(/\\\\/, '\\\\'), 'i');\n }\n \n // Extra external link CSS selector exclusion.\n var extCssExclude = false;\n if (drupalSettings.data.extlink.extCssExclude) {\n extCssExclude = drupalSettings.data.extlink.extCssExclude;\n }\n \n // Extra external link CSS selector explicit.\n var extCssExplicit = false;\n if (drupalSettings.data.extlink.extCssExplicit) {\n extCssExplicit = drupalSettings.data.extlink.extCssExplicit;\n }\n \n // Find all links which are NOT internal and begin with http as opposed\n // to ftp://, javascript:, etc. other kinds of links.\n // When operating on the 'this' variable, the host has been appended to\n // all links by the browser, even local ones.\n // In jQuery 1.1 and higher, we'd use a filter method here, but it is not\n // available in jQuery 1.0 (Drupal 5 default).\n var external_links = [];\n var mailto_links = [];\n $('a:not([data-extlink]), area:not([data-extlink])', context).each(function (el) {\n try {\n var url = '';\n if (typeof this.href == 'string') {\n url = this.href.toLowerCase();\n }\n // Handle SVG links (xlink:href).\n else if (typeof this.href == 'object') {\n url = this.href.baseVal;\n }\n if (url.indexOf('http') === 0\n && ((!internal_link.test(url) && !(extExclude && extExclude.test(url))) || (extInclude && extInclude.test(url)))\n && !(extCssExclude && $(this).is(extCssExclude))\n && !(extCssExclude && $(this).parents(extCssExclude).length > 0)\n && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) {\n var match = false;\n if (whitelistedDomains) {\n for (var i = 0; i < whitelistedDomains.length; i++) {\n if (whitelistedDomains[i].test(url)) {\n match = true;\n break;\n }\n }\n }\n if (!match) {\n external_links.push(this);\n }\n }\n // Do not include area tags with begin with mailto: (this prohibits\n // icons from being added to image-maps).\n else if (this.tagName !== 'AREA'\n && url.indexOf('mailto:') === 0\n && !(extCssExclude && $(this).parents(extCssExclude).length > 0)\n && !(extCssExplicit && $(this).parents(extCssExplicit).length < 1)) {\n mailto_links.push(this);\n }\n }\n // IE7 throws errors often when dealing with irregular links, such as:\n // <a href=\"node/10\"></a> Empty tags.\n // <a href=\"http://user:pass@example.com\">example</a> User:pass syntax.\n catch (error) {\n return false;\n }\n });\n \n if (drupalSettings.data.extlink.extClass !== '0' && drupalSettings.data.extlink.extClass !== '') {\n Drupal.extlink.applyClassAndSpan(external_links, drupalSettings.data.extlink.extClass, extIconPlacement);\n }\n \n if (drupalSettings.data.extlink.mailtoClass !== '0' && drupalSettings.data.extlink.mailtoClass !== '') {\n Drupal.extlink.applyClassAndSpan(mailto_links, drupalSettings.data.extlink.mailtoClass, extIconPlacement);\n }\n \n if (drupalSettings.data.extlink.extTarget) {\n // Apply the target attribute to all links.\n $(external_links).filter(function () {\n // Filter out links with target set if option specified.\n return !(drupalSettings.data.extlink.extTargetNoOverride && $(this).is('a[target]'));\n }).attr({target: '_blank'});\n \n // Add noopener rel attribute to combat phishing.\n $(external_links).attr('rel', function (i, val) {\n // If no rel attribute is present, create one with the value noopener.\n if (val === null || typeof val === 'undefined') {\n return 'noopener';\n }\n // Check to see if rel contains noopener. Add what doesn't exist.\n if (val.indexOf('noopener') > -1) {\n if (val.indexOf('noopener') === -1) {\n return val + ' noopener';\n }\n // Noopener exists. Nothing needs to be added.\n else {\n return val;\n }\n }\n // Else, append noopener to val.\n else {\n return val + ' noopener';\n }\n });\n }\n \n if (drupalSettings.data.extlink.extNofollow) {\n $(external_links).attr('rel', function (i, val) {\n // When the link does not have a rel attribute set it to 'nofollow'.\n if (val === null || typeof val === 'undefined') {\n return 'nofollow';\n }\n var target = 'nofollow';\n // Change the target, if not overriding follow.\n if (drupalSettings.data.extlink.extFollowNoOverride) {\n target = 'follow';\n }\n if (val.indexOf(target) === -1) {\n return val + ' nofollow';\n }\n return val;\n });\n }\n \n if (drupalSettings.data.extlink.extNoreferrer) {\n $(external_links).attr('rel', function (i, val) {\n // When the link does not have a rel attribute set it to 'noreferrer'.\n if (val === null || typeof val === 'undefined') {\n return 'noreferrer';\n }\n if (val.indexOf('noreferrer') === -1) {\n return val + ' noreferrer';\n }\n return val;\n });\n }\n \n Drupal.extlink = Drupal.extlink || {};\n \n // Set up default click function for the external links popup. This should be\n // overridden by modules wanting to alter the popup.\n Drupal.extlink.popupClickHandler = Drupal.extlink.popupClickHandler || function () {\n if (drupalSettings.data.extlink.extAlert) {\n return confirm(drupalSettings.data.extlink.extAlertText);\n }\n };\n \n $(external_links).off(\"click.extlink\");\n $(external_links).on(\"click.extlink\", function (e) {\n return Drupal.extlink.popupClickHandler(e, this);\n });\n };\n \n /**\n * Apply a class and a trailing <span> to all links not containing images.\n *\n * @param {object[]} links\n * An array of DOM elements representing the links.\n * @param {string} class_name\n * The class to apply to the links.\n * @param {string} icon_placement\n * 'append' or 'prepend' the icon to the link.\n */\n Drupal.extlink.applyClassAndSpan = function (links, class_name, icon_placement) {\n var $links_to_process;\n if (drupalSettings.data.extlink.extImgClass) {\n $links_to_process = $(links);\n }\n else {\n var links_with_images = $(links).find('img, svg').parents('a');\n $links_to_process = $(links).not(links_with_images);\n }\n \n if (class_name !== '0') {\n $links_to_process.addClass(class_name);\n }\n \n // Add data-extlink attribute.\n $links_to_process.attr('data-extlink', '');\n \n var i;\n var length = $links_to_process.length;\n for (i = 0; i < length; i++) {\n var $link = $($links_to_process[i]);\n if (drupalSettings.data.extlink.extUseFontAwesome) {\n if (class_name === drupalSettings.data.extlink.mailtoClass) {\n $link[icon_placement]('<span class=\"fa-' + class_name + ' extlink\"><span class=\"' + drupalSettings.data.extlink.extFaMailtoClasses + '\" aria-label=\"' + drupalSettings.data.extlink.mailtoLabel + '\"></span></span>');\n }\n else {\n $link[icon_placement]('<span class=\"fa-' + class_name + ' extlink\"><span class=\"' + drupalSettings.data.extlink.extFaLinkClasses + '\" aria-label=\"' + drupalSettings.data.extlink.extLabel + '\"></span></span>');\n }\n }\n else {\n if (class_name === drupalSettings.data.extlink.mailtoClass) {\n $link[icon_placement]('<svg focusable=\"false\" class=\"' + class_name + '\" role=\"img\" aria-label=\"' + drupalSettings.data.extlink.mailtoLabel + '\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 10 70 20\"><metadata><sfw xmlns=\"http://ns.adobe.com/SaveForWeb/1.0/\"><sliceSourceBounds y=\"-8160\" x=\"-8165\" width=\"16389\" height=\"16384\" bottomLeftOrigin=\"true\"/><optimizationSettings><targetSettings targetSettingsID=\"0\" fileFormat=\"PNG24Format\"><PNG24Format transparency=\"true\" filtered=\"false\" interlaced=\"false\" noMatteColor=\"false\" matteColor=\"#FFFFFF\"/></targetSettings></optimizationSettings></sfw></metadata><title>' + drupalSettings.data.extlink.mailtoLabel + '</title><path d=\"M56 14H8c-1.1 0-2 0.9-2 2v32c0 1.1 0.9 2 2 2h48c1.1 0 2-0.9 2-2V16C58 14.9 57.1 14 56 14zM50.5 18L32 33.4 13.5 18H50.5zM10 46V20.3l20.7 17.3C31.1 37.8 31.5 38 32 38s0.9-0.2 1.3-0.5L54 20.3V46H10z\"/></svg>');\n }\n else {\n $link[icon_placement]('<svg focusable=\"false\" class=\"' + class_name + '\" role=\"img\" aria-label=\"' + drupalSettings.data.extlink.extLabel + '\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 80 40\"><metadata><sfw xmlns=\"http://ns.adobe.com/SaveForWeb/1.0/\"><sliceSourceBounds y=\"-8160\" x=\"-8165\" width=\"16389\" height=\"16384\" bottomLeftOrigin=\"true\"/><optimizationSettings><targetSettings targetSettingsID=\"0\" fileFormat=\"PNG24Format\"><PNG24Format transparency=\"true\" filtered=\"false\" interlaced=\"false\" noMatteColor=\"false\" matteColor=\"#FFFFFF\"/></targetSettings></optimizationSettings></sfw></metadata><title>' + drupalSettings.data.extlink.extLabel + '</title><path d=\"M48 26c-1.1 0-2 0.9-2 2v26H10V18h26c1.1 0 2-0.9 2-2s-0.9-2-2-2H8c-1.1 0-2 0.9-2 2v40c0 1.1 0.9 2 2 2h40c1.1 0 2-0.9 2-2V28C50 26.9 49.1 26 48 26z\"/><path d=\"M56 6H44c-1.1 0-2 0.9-2 2s0.9 2 2 2h7.2L30.6 30.6c-0.8 0.8-0.8 2 0 2.8C31 33.8 31.5 34 32 34s1-0.2 1.4-0.6L54 12.8V20c0 1.1 0.9 2 2 2s2-0.9 2-2V8C58 6.9 57.1 6 56 6z\"/></svg>');\n }\n }\n }\n };\n \n Drupal.behaviors.extlink = Drupal.behaviors.extlink || {};\n Drupal.behaviors.extlink.attach = function (context, drupalSettings) {\n // Backwards compatibility, for the benefit of modules overriding extlink\n // functionality by defining an \"extlinkAttach\" global function.\n if (typeof extlinkAttach === 'function') {\n extlinkAttach(context);\n }\n else {\n Drupal.extlink.attach(context, drupalSettings);\n }\n };\n \n })(jQuery, Drupal, drupalSettings);\n \n\n//# sourceURL=webpack://dev.eql.fr/./scripts/extlink.js?\n}");
- /***/ }),
- /***/ "./scripts/main.js":
- /*!*************************!*\
- !*** ./scripts/main.js ***!
- \*************************/
- /***/ (function() {
- eval("{jQuery(function ($) {\n console.log('salut');\n\n // MENU BURGER\n const burger = document.getElementById(\"block-burger\");\n const burgertitle = document.getElementById(\"block-burger-menu\");\n if (burger && burgertitle) {\n burgertitle.addEventListener(\"click\", function () {\n burger.classList.toggle('opened');\n });\n }\n\n // FAQ — réponses\n const answers = document.getElementsByClassName(\"field--name-field-reponse\");\n const fichiers = document.getElementsByClassName(\"field--name-field-fichiers\");\n const liens = document.getElementsByClassName(\"field--name-field-liens\");\n const ressources = document.getElementsByClassName(\"field--name-field-ress\");\n const questions = document.getElementsByClassName(\"field--name-field-question\");\n\n for (let i = 0; i < questions.length; i++) {\n const q = questions[i];\n q.addEventListener(\"click\", function () {\n // Réponses\n Array.from(answers).forEach(a => a.classList.remove(\"opened\"));\n const r = this.parentNode.querySelector(\".field--name-field-reponse\");\n if (r) r.classList.add(\"opened\");\n\n // Fichiers\n Array.from(fichiers).forEach(f => f.classList.remove(\"opened\"));\n const f = this.parentNode.querySelector(\".field--name-field-fichiers\");\n if (f) f.classList.add(\"opened\");\n\n // Liens\n Array.from(liens).forEach(l => l.classList.remove(\"opened\"));\n const l = this.parentNode.querySelector(\".field--name-field-liens\");\n if (l) l.classList.add(\"opened\");\n\n // Ressources\n Array.from(ressources).forEach(r => r.classList.remove(\"opened\"));\n const res = this.parentNode.querySelector(\".field--name-field-ress\");\n if (res) res.classList.add(\"opened\");\n });\n }\n\n // SLIDESHOW INIT\n $('.path-frontpage .view-actus-blocks-pages .view-content .view-type-slide .views-row-wrapper').slick({\n slidesToShow: 1,\n dots: true,\n arrows: true,\n centerMode: true,\n responsive: [{\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n adaptiveHeight: true,\n arrows: false,\n draggable: true,\n centerMode: true,\n }\n }]\n });\n\n $('.page-node-type-actualite .block-entity-fieldnodefield-images .field--type-image').slick({\n dots: true,\n arrows: true,\n adaptiveHeight: true,\n responsive: [{\n breakpoint: 800,\n settings: { adaptiveHeight: true }\n }]\n });\n\n $('.page-node-type-projet .block-entity-fieldnodefield-photo .field--type-image').slick({\n slidesToShow: 1,\n dots: true,\n arrows: true,\n draggable: true,\n adaptiveHeight: true,\n responsive: [{\n breakpoint: 800,\n settings: { adaptiveHeight: true }\n }]\n });\n \n\n\n \n \n ///// fusion views-type-slide de class identique ////////////\n\n const seen = new Set();\n \n $('.view-type-slide').each(function () {\n const $slide = $(this);\n const classes = $slide.attr('class').split(/\\s+/);\n const typeClass = classes.find(cls => cls.startsWith('type-'));\n \n if (typeClass) {\n if (seen.has(typeClass)) {\n // Trouver le premier slide avec cette classe\n const $target = $('.view-type-slide.' + typeClass).first();\n \n // Déplacer les rows de la slide actuelle vers la première\n $slide.find('.views-row').appendTo($target.find('.views-row-wrapper'));\n \n // Supprimer la slide en double\n $slide.remove();\n } else {\n seen.add(typeClass);\n }\n }\n });\n if (!$('.view-content').hasClass('filtered')) {\n $('.path-ressources .view:not(.view-partenaires) .view-content .view-type-slide .views-row-wrapper').slick({\n slidesToShow: 3,\n dots: false,\n arrows: true,\n infinite: false,\n centerMode: false,\n draggable: true,\n \n responsive: [{\n breakpoint: 810,\n settings: {\n slidesToShow: 1,\n dots: false,\n arrows: true,\n draggable: true,\n centerMode: true,\n\n }\n }]\n });\n }\n\n\n // Classes media → .wrapper-ressource\n $(\".wrapper-ressource\").each(function () {\n const media = $(this).find(\".field--name-field-type-de-media\").text().trim();\n const className = media\n .toLowerCase()\n .normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\")\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/(^-|-$)/g, '');\n $(this).addClass('type-media-' + className);\n });\n console.log(\"classses media\");\n\n // MASQUER TYPE DE RESSOURCE DOUBLON\n if (document.body.classList.contains(\"path-ressources\")) {\n $(\".view-type-slide\").each(function () {\n const h3Content = $(this).find(\"h3\").text().trim();\n console.log(h3Content);\n $(this).find(\".field--name-field-type-de-ressource .field__item a\").each(function () {\n if ($(this).text().trim() === h3Content) {\n $(this).hide();\n }\n });\n });\n\n }\n\n // Ouvrir les liens externes dans un nouvel onglet\n document.querySelectorAll('a[href^=\"http\"]').forEach(link => {\n if (!link.href.includes(location.hostname)) {\n link.setAttribute('target', '_blank');\n link.setAttribute('rel', 'noopener noreferrer');\n }\n });\n\n // Scroll automatique au filtre\n if (document.body.classList.contains(\"path-projets\")) {\n const form = document.querySelector(\".views-exposed-form\");\n if (form) form.setAttribute(\"action\", form.action.split(\"#\")[0] + \"#filtres\");\n\n if (window.location.hash === \"#filtres\") {\n const target = document.getElementById(\"filtres\");\n if (target) {\n const offset = 300;\n const top = target.getBoundingClientRect().top + window.pageYOffset - offset;\n window.scrollTo({ top: top, behavior: \"smooth\" });\n }\n }\n\n\n }\n});\n\n/////////////////start diaporama ressource //////////\ndocument.addEventListener('DOMContentLoaded', function () {\n // Vérifie que le body a la classe souhaitée\n if (!document.body.classList.contains('type-media-images---photos')) return;\n\n // Attendre que les éléments HTML soient bien présents\n const interval = setInterval(() => {\n const mainImage = document.getElementById('mainImage');\n const prevArrow = document.getElementById('prevArrow');\n const nextArrow = document.getElementById('nextArrow');\n const caption = document.getElementById('caption');\n const thumbsContainer = document.getElementById('thumbnails');\n const imagesInDom = document.querySelectorAll('.carousel-items .carousel-item img');\n\n if (mainImage && prevArrow && nextArrow && caption && thumbsContainer && imagesInDom.length > 0) {\n clearInterval(interval); // Tous les éléments sont là, on lance le carrousel\n initCarousel({ mainImage, prevArrow, nextArrow, caption, thumbsContainer });\n }\n }, 100);\n});\n\nfunction initCarousel({ mainImage, prevArrow, nextArrow, caption, thumbsContainer }) {\n const images = [];\n // Adapter l'orientation des vignettes si écran < 810px\nfunction applyResponsiveThumbnailsLayout() {\n if (window.innerWidth < 810) {\n thumbsContainer.style.flexDirection = 'row';\n thumbsContainer.style.flexWrap = 'nowrap';\n thumbsContainer.style.overflowX = 'auto';\n thumbsContainer.style.overflowY = 'hidden';\n thumbsContainer.style.display = 'flex';\n thumbsContainer.style.justifyContent = 'center';\n } else {\n thumbsContainer.style.flexDirection = 'column';\n thumbsContainer.style.overflowY = 'auto';\n thumbsContainer.style.overflowX = 'hidden';\n }\n}\napplyResponsiveThumbnailsLayout();\nwindow.addEventListener('resize', applyResponsiveThumbnailsLayout);\n\n document.querySelectorAll('.carousel-items .carousel-item img').forEach((img) => {\n images.push({\n src: img.getAttribute('src'),\n caption: img.getAttribute('alt') || ''\n });\n });\n\n if (!images.length) return;\n\n let currentIndex = 0;\n\n // function scrollThumbnailToCenter(index) {\n // const thumbnails = document.querySelectorAll('.thumbnails img');\n // const activeThumb = thumbnails[index];\n // if (activeThumb && thumbsContainer) {\n // const containerHeight = thumbsContainer.clientHeight;\n // const thumbOffsetTop = activeThumb.offsetTop;\n // const thumbHeight = activeThumb.offsetHeight;\n // const scrollTarget = thumbOffsetTop - (containerHeight / 2) + (thumbHeight / 2);\n // thumbsContainer.scrollTo({ top: scrollTarget, behavior: 'smooth' });\n // }\n // }\n function scrollThumbnailToCenter(index) {\n const thumbnails = document.querySelectorAll('.thumbnails img');\n const activeThumb = thumbnails[index];\n if (activeThumb && thumbsContainer) {\n const isMobile = window.innerWidth < 810;\n \n if (isMobile) {\n // Scroll horizontal\n const containerWidth = thumbsContainer.clientWidth;\n const thumbOffsetLeft = activeThumb.offsetLeft;\n const thumbWidth = activeThumb.offsetWidth;\n const scrollTarget = thumbOffsetLeft - (containerWidth / 2) + (thumbWidth / 2);\n thumbsContainer.scrollTo({ left: scrollTarget, behavior: 'smooth' });\n } else {\n // Scroll vertical\n const containerHeight = thumbsContainer.clientHeight;\n const thumbOffsetTop = activeThumb.offsetTop;\n const thumbHeight = activeThumb.offsetHeight;\n const scrollTarget = thumbOffsetTop - (containerHeight / 2) + (thumbHeight / 2);\n thumbsContainer.scrollTo({ top: scrollTarget, behavior: 'smooth' });\n }\n }\n }\n \n\n function showImage(index) {\n mainImage.src = images[index].src;\n caption.textContent = images[index].caption;\n\n const thumbnails = document.querySelectorAll('.thumbnails img');\n thumbnails.forEach(img => img.classList.remove('active'));\n if (thumbnails[index]) {\n thumbnails[index].classList.add('active');\n scrollThumbnailToCenter(index);\n }\n }\n\n prevArrow.addEventListener('click', () => {\n currentIndex = (currentIndex - 1 + images.length) % images.length;\n showImage(currentIndex);\n });\n\n nextArrow.addEventListener('click', () => {\n currentIndex = (currentIndex + 1) % images.length;\n showImage(currentIndex);\n });\n\n images.forEach((img, index) => {\n const thumb = document.createElement('img');\n thumb.src = img.src;\n thumb.alt = img.caption;\n thumb.addEventListener('click', () => {\n currentIndex = index;\n showImage(index);\n });\n thumbsContainer.appendChild(thumb);\n });\n\n showImage(currentIndex);\n\n const thumbPrev = document.getElementById('thumbPrev');\n const thumbNext = document.getElementById('thumbNext');\n\n // ✅ Masquer les flèches de thumbnails si pas assez d’images pour scroller\n const thumbHeight = 70; // approx : image + gap\n const visibleCount = Math.floor(thumbsContainer.clientHeight / thumbHeight);\n if (images.length <= visibleCount) {\n if (thumbPrev) thumbPrev.style.display = 'none';\n if (thumbNext) thumbNext.style.display = 'none';\n }\n\n // Boucle haut/bas avec scroll\n thumbPrev.addEventListener('click', () => {\n if (thumbsContainer.scrollTop <= 0) {\n thumbsContainer.scrollTo({ top: thumbsContainer.scrollHeight, behavior: 'smooth' });\n } else {\n thumbsContainer.scrollBy({ top: -150, behavior: 'smooth' });\n }\n });\n\n thumbNext.addEventListener('click', () => {\n const maxScrollTop = thumbsContainer.scrollHeight - thumbsContainer.clientHeight;\n if (thumbsContainer.scrollTop >= maxScrollTop - 1) {\n thumbsContainer.scrollTo({ top: 0, behavior: 'smooth' });\n } else {\n thumbsContainer.scrollBy({ top: 150, behavior: 'smooth' });\n }\n });\n}\n\n \n/////////////////end diaporama ressource //////////\n\n\n//////////////////////////start classe en JS si des filtres sont présents///////////\ndocument.addEventListener('DOMContentLoaded', () => {\n if (window.location.search.length > 0) {\n document.querySelector('.view-content')?.classList.add('filtered');\n document.querySelectorAll('.tout-voir').forEach(btn => btn.remove());\n\n }\n});\n//////////////////////////end classe en JS si des filtres sont présents///////////\n\n// ////////////////// start tronquage sous titre //////////////////\n document.addEventListener(\"DOMContentLoaded\", function () {\n const maxLength = 80;\n\n document.querySelectorAll('.view-base-de-donnees .wrapper-ressource .field--name-field-sous-titre a').forEach(function (element) {\n const fullText = element.textContent.trim();\n\n if (fullText.length > maxLength) {\n const truncated = fullText.slice(0, maxLength).trim() + '...';\n element.textContent = truncated;\n }\n });\n });\n // //////////////////end tronquage sous titre //////////////////\n\n////////////////// start boutons media ////////////////\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n const mediaButtons = document.querySelectorAll('.buttons-filtres-ressources a');\n\n mediaButtons.forEach(button => {\n button.addEventListener('click', function (e) {\n e.preventDefault();\n\n // Récupérer l’ID media depuis l’URL du bouton\n const url = new URL(button.href);\n const mediaID = url.searchParams.get('field_type_de_media_target_id');\n\n // Appliquer la valeur dans le <select>\n const select = document.getElementById('edit-field-type-de-media-target-id');\n if (select) {\n select.value = mediaID;\n // Simuler le clic sur le bouton \"Appliquer\"\n const submit = document.querySelector('input#edit-submit-base-de-donnees');\n if (submit) {\n submit.click();\n }\n }\n });\n });\n});\n////////////////// end boutons media ////////////////\n\n////////////////// start bouton \"Tout voir\" ////////////////\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n const toutVoirButtons = document.querySelectorAll('.tout-voir');\n\n toutVoirButtons.forEach(button => {\n button.addEventListener('click', function () {\n const tid = this.dataset.tid;\n const select = document.getElementById('edit-field-type-de-ressource-target-id');\n\n if (!select) return;\n\n const optionExists = Array.from(select.options).some(o => o.value === tid);\n if (!optionExists) {\n alert(\"Le type de ressource sélectionné n’est pas disponible.\");\n return;\n }\n\n select.value = tid;\n select.dispatchEvent(new Event('change'));\n\n const form = select.closest('form');\n if (form) {\n const submitButton = form.querySelector('input[type=\"submit\"]');\n if (submitButton) {\n submitButton.click();\n } else {\n form.submit();\n }\n }\n });\n });\n});\n\n\n////////////////// end bouton \"Tout voir\" ////////////////\n\n\n\n////////////// start croix clear input recherche ////////////\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n const input = document.getElementById(\"edit-combine\");\n const clearBtn = document.querySelector('.form-item-combine .clear-input');\n const form = document.querySelector(\"form.views-exposed-form\");\n\n if (input && clearBtn && form) {\n // Affiche la croix si contenu présent\n input.addEventListener('input', () => {\n clearBtn.style.display = input.value ? 'block' : 'none';\n });\n\n // Efface et soumet le formulaire\n clearBtn.addEventListener('click', () => {\n input.value = '';\n clearBtn.style.display = 'none';\n input.focus();\n form.submit(); // déclenche la recherche sans rechargement manuel\n });\n\n // Affiche la croix au chargement si une valeur est déjà présente\n if (input.value) {\n clearBtn.style.display = 'block';\n }\n }\n});\n\n\n////////////// end croix clear input recherche ////////////\n\n\n//# sourceURL=webpack://dev.eql.fr/./scripts/main.js?\n}");
- /***/ }),
- /***/ "./scss/styles.scss":
- /*!**************************!*\
- !*** ./scss/styles.scss ***!
- \**************************/
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
- "use strict";
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (__webpack_require__.p + \"./css/bundle.css\");\n\n//# sourceURL=webpack://dev.eql.fr/./scss/styles.scss?\n}");
- /***/ })
- /******/ });
- /************************************************************************/
- /******/ // The require scope
- /******/ var __webpack_require__ = {};
- /******/
- /************************************************************************/
- /******/ /* webpack/runtime/global */
- /******/ !function() {
- /******/ __webpack_require__.g = (function() {
- /******/ if (typeof globalThis === 'object') return globalThis;
- /******/ try {
- /******/ return this || new Function('return this')();
- /******/ } catch (e) {
- /******/ if (typeof window === 'object') return window;
- /******/ }
- /******/ })();
- /******/ }();
- /******/
- /******/ /* webpack/runtime/make namespace object */
- /******/ !function() {
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = function(exports) {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/ }();
- /******/
- /******/ /* webpack/runtime/publicPath */
- /******/ !function() {
- /******/ var scriptUrl;
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
- /******/ var document = __webpack_require__.g.document;
- /******/ if (!scriptUrl && document) {
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
- /******/ scriptUrl = document.currentScript.src;
- /******/ if (!scriptUrl) {
- /******/ var scripts = document.getElementsByTagName("script");
- /******/ if(scripts.length) {
- /******/ var i = scripts.length - 1;
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
- /******/ }
- /******/ }
- /******/ }
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
- /******/ __webpack_require__.p = scriptUrl;
- /******/ }();
- /******/
- /************************************************************************/
- /******/
- /******/ // startup
- /******/ // Load entry module and return exports
- /******/ // This entry module can't be inlined because the eval devtool is used.
- /******/ __webpack_modules__["./scripts/main.js"](0, {}, __webpack_require__);
- /******/ __webpack_modules__["./scripts/extlink.js"](0, {}, __webpack_require__);
- /******/ var __webpack_exports__ = {};
- /******/ __webpack_modules__["./scss/styles.scss"](0, __webpack_exports__, __webpack_require__);
- /******/
- /******/ })()
- ;
|