{"version":3,"sources":["Scripts/src/apps/festival/2022/main.js"],"names":["nav","document","getElementById","toggleMenu","w","window","d","e","documentElement","g","getElementsByTagName","x","innerWidth","clientWidth","y","innerHeight","clientHeight","BREAKPOINT","bgHero","style","createElement","appendChild","createTextNode","head","bg","body","getAttribute","sheet","insertRule","getParams","url","params","parser","href","query","search","substring","vars","split","i","length","pair","decodeURIComponent","simulateClick","elem","evt","MouseEvent","bubbles","cancelable","view","dispatchEvent","slideFestival","a","b","c","plusSlides","n","showSlides","slideIndex","slides","getElementsByClassName","display","querySelector","addEventListener","next","main","lazy","forEach","call","querySelectorAll","img","setAttribute","onload","removeAttribute","onerror","src","show","hide","toggle","getComputedStyle","event","this","classList","subMenu","add","remove","tools","btSocial","preventDefault","open","init","home","slider","current","pathSlide","settings","interval","colorTitre","colorNav","logoAlt","textDecompte","launchSlide","setInterval","opacity","setProperty","setImgSlider","Promise","resolve","reject","then","MediaBox","slidesTempsForts","undefined","bandeAnnonce","location","video","someLink","pageFilms","referrer","origin","retour","getPropertyValue","filtrerProgramme","infosFilms","items","filtered","filtered_json","pushData","id","titre","innerHTML","jour","theme","salle","infoFilm","push","resetFilters","mobile","filterFn","filtresActifs","testJour","testTheme","sectionIdV","sectionIdS","sectionIdD","sections","Array","prototype","el","radiosJour","getElementsByName","radiosTheme","includes","concat","storageFilters","localStorage","festivalFiltre","getItem","getSessionStorageObj","JSON","parse","stringify","setItem","jefiltre","type","target","hasAttribute","checked","libelleMobileTheme","libelleMobileJour","showPlan","baguetteBox","run","animation","noScrollbars","page"],"mappings":"00CACA,IAAIA,MAAMC,SAASC,eAAe,cACjCC,WAAaF,SAASC,eAAe,cAGlCE,EAAIC,OACPC,EAAIL,SACJM,EAAID,EAAEE,gBACNC,EAAIH,EAAEI,qBAAqB,QAAQ,GACnCC,EAAIP,EAAEQ,YAAcL,EAAEM,aAAeJ,EAAEI,YACvCC,EAAIV,EAAEW,aAAeR,EAAES,cAAgBP,EAAEO,aAEpCC,WAAa,IAI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MAID,KAAK,YACJxE","file":"static/scripts/apps/festival/2022/main.min.js.map","sourcesContent":["/// Variables\r\nvar nav = document.getElementById('navigation'),\r\n\ttoggleMenu = document.getElementById('toggleMenu');\r\n\r\n/// vanilla JS window width and height\r\nvar w = window,\r\n\td = document,\r\n\te = d.documentElement,\r\n\tg = d.getElementsByTagName('body')[0],\r\n\tx = w.innerWidth || e.clientWidth || g.clientWidth,\r\n\ty = w.innerHeight || e.clientHeight || g.clientHeight;\r\n\r\nconst BREAKPOINT = 769;\r\n///\r\n/// Gestion image panoramique (mobile|desktop)\r\n///\r\nvar bgHero = function () {\r\n\tvar style = document.createElement('style');\r\n\tstyle.appendChild(document.createTextNode(''));\r\n\tdocument.head.appendChild(style);\r\n\t//return style.sheet;\r\n\r\n\tvar bg = x > 768 ? document.body.getAttribute('data-bg') : document.body.getAttribute('data-bg-mobile');\r\n\tstyle.sheet.insertRule('body:before {background-image: url(' + bg + ') }', 0);\r\n}\r\n///\r\n/// Get the URL parameters\r\n/// source: https://css-tricks.com/snippets/javascript/get-url-variables/\r\n/// @param {String} url The URL\r\n/// @return {Object} The URL parameters\r\n///\r\nvar getParams = function (url) {\r\n\tvar params = {};\r\n\tvar parser = document.createElement('a');\r\n\tparser.href = url;\r\n\tvar query = parser.search.substring(1);\r\n\tvar vars = query.split('&');\r\n\tfor (var i = 0; i < vars.length; i++) {\r\n\t\tvar pair = vars[i].split('=');\r\n\t\tparams[pair[0]] = decodeURIComponent(pair[1]);\r\n\t}\r\n\treturn params;\r\n};\r\n\r\n///\r\n/// Simulate a click event.\r\n/// @public\r\n/// @param {Element} elem the element to simulate a click on\r\n///\r\nvar simulateClick = function (elem) {\r\n\t// Create our event (with options)\r\n\tvar evt = new MouseEvent('click', {\r\n\t\tbubbles: true,\r\n\t\tcancelable: true,\r\n\t\tview: window\r\n\t});\r\n\t// If cancelled, don't dispatch our event\r\n\tvar canceled = !elem.dispatchEvent(evt);\r\n};\r\n\r\n\r\n\r\n///\r\n///\r\n///\r\nvar slideFestival = function (a, b, c) {\r\n\tvar slideIndex = 1;\r\n\tshowSlides(slideIndex);\r\n\r\n\tfunction plusSlides(n) {\r\n\t\tshowSlides(slideIndex += n);\r\n\t}\r\n\r\n\tfunction currentSlide(n) {\r\n\t\tshowSlides(slideIndex = n);\r\n\t}\r\n\r\n\tfunction showSlides(n) {\r\n\t\tvar i;\r\n\t\tvar slides = document.getElementsByClassName(a);\r\n\t\tif (n > slides.length) {\r\n\t\t\tslideIndex = 1\r\n\t\t}\r\n\t\tif (n < 1) {\r\n\t\t\tslideIndex = slides.length\r\n\t\t}\r\n\t\tfor (i = 0; i < slides.length; i++) {\r\n\t\t\tslides[i].style.display = \"none\";\r\n\t\t}\r\n\t\tslides[slideIndex - 1].style.display = \"block\";\r\n\t}\r\n\r\n\tif (document.querySelector(b) != null) {\r\n\r\n\t\tdocument.querySelector(b).addEventListener('click', function () {\r\n\t\t\tplusSlides(-1);\r\n\t\t});\r\n\t}\r\n\tif (document.getElementsByClassName(c) != null) {\r\n\r\n\t\tvar next = document.getElementsByClassName(c);\r\n\r\n\t\tfor (var i = 0; i < next.length; i++) {\r\n\t\t\tnext[i].addEventListener('click', function (e) {\r\n\t\t\t\tplusSlides(1);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}\r\n\r\n///\r\n/// All pages\r\n///\r\nvar main = {\r\n\t///\r\n\t/// Lazy load\r\n\t///\r\n\tlazy() {\r\n\t\t[].forEach.call(document.querySelectorAll('img[data-src]'), function (img) {\r\n\t\t\tvar dataSrc = img.getAttribute('data-src');\r\n\r\n\t\t\timg.setAttribute('src', img.getAttribute('data-src'));\r\n\r\n\t\t\timg.onload = function () {\r\n\t\t\t\timg.removeAttribute('data-src');\r\n\t\t\t};\r\n\t\t\timg.onerror = function () {\r\n\t\t\t\timg.src = 'https://placeholder.pics/svg/300x209/CCCCCC';\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\t///\r\n\t/// Navigation\r\n\t///\r\n\tnav() {\r\n\t\t// Show\r\n\t\tvar show = function (elem) {\r\n\t\t\telem.style.display = 'block';\r\n\t\t};\r\n\t\t// Hide\r\n\t\tvar hide = function (elem) {\r\n\t\t\telem.style.display = 'none';\r\n\t\t};\r\n\t\t// Toggle\r\n\t\tvar toggle = function (elem) {\r\n\t\t\tif (window.getComputedStyle(elem).display === 'block') {\r\n\t\t\t\thide(elem);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tshow(elem);\r\n\t\t};\r\n\r\n\t\tif (x < 1025) {\r\n\t\t\tnav.style.display = 'none';\r\n\t\t\ttoggleMenu.addEventListener('click', function (event) {\r\n\t\t\t\ttoggle(nav);\r\n\t\t\t\tthis.classList.toggle('is-active');\r\n\t\t\t\tnav.classList.toggle('is-active');\r\n\t\t\t\tdocument.body.classList.toggle('has-modal');\r\n\t\t\t}, false);\r\n\t\t} else {\r\n\t\t\tvar subMenu = document.getElementById('submenu');\r\n\r\n\t\t\tsubMenu.addEventListener('mouseenter', function (event) {\r\n\t\t\t\tnav.classList.add('submenu-is-active');\r\n\t\t\t}, false);\r\n\r\n\t\t\tsubMenu.addEventListener('mouseleave', function (event) {\r\n\t\t\t\tnav.classList.remove('submenu-is-active');\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\t///\r\n\t/// utilities\r\n\t///\r\n\ttools() {\r\n\t\tif (x < 1024) {\r\n\t\t\tdocument.body.classList.add('is-mobile');\r\n\t\t}\r\n\r\n\t\tvar btSocial = document.getElementsByClassName('social--share');\r\n\t\tfor (var i = 3; i >= 0; i--) {\r\n\t\t\tbtSocial[i].addEventListener('click', function (e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\twindow.open(this.getAttribute('href'), 'popupWindow', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500px,width=400px');\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\t///\r\n\t/// initialisation des functions\r\n\t///\r\n\tinit() {\r\n\t\tthis.lazy();\r\n\t\tthis.tools();\r\n\t\tthis.nav();\r\n\t}\r\n}\r\n\r\n///\r\n/// Home\r\n///\r\nvar home = {\r\n\t///\r\n\t/// Lazy load\r\n\t///\r\n\tslider() {\r\n\t\tvar current = 0,\r\n\t\t\tpathSlide = settings.slides,\r\n\t\t\tinterval = settings.interval,\r\n\t\t\tcolorTitre = settings.colorTitre,\r\n\t\t\tcolorNav = settings.colorNav,\r\n\t\t\tlogoAlt = settings.logoAlt,\r\n\t\t\ttextDecompte = settings.textDecompte,\r\n\t\t\tslides = document.getElementsByClassName('slide');\r\n\r\n\t\tvar changeColor = function (a) {\r\n\t\t\tdocument.body.style.setProperty('--color-primary', a);\r\n\t\t}\r\n\r\n\t\tvar launchSlide = function () {\r\n\t\t\tsetInterval(function () {\r\n\t\t\t\tfor (var i = 0; i < slides.length; i++) {\r\n\t\t\t\t\tslides[i].style.opacity = 0;\r\n\t\t\t\t}\r\n\t\t\t\tcurrent = (current != slides.length - 1) ? current + 1 : 0;\r\n\t\t\t\tslides[current].style.opacity = 1;\r\n\r\n\t\t\t\tdocument.getElementById('pictoBA').setAttribute('srcset', '/Content/img/pictos/play-circle-24-' + colorTitre[current].substring(1) + '.svg')\r\n\r\n\t\t\t\t// On pousse la bonne couleur pour le logo\r\n\t\t\t\tdocument.body.style.setProperty('--color-primary', colorTitre[current]);\r\n\r\n\t\t\t\tdocument.getElementById('homeHeader').style.setProperty('--color-primary', colorNav[current]);\r\n\r\n\t\t\t\tlogoAlt[current] ? document.body.classList.add('has-logo-alt') : document.body.classList.remove('has-logo-alt');\r\n\t\t\t\ttextDecompte[current] ? document.body.classList.add('has-text-alt') : document.body.classList.remove('has-text-alt');\r\n\r\n\t\t\t}, interval);\r\n\t\t}\r\n\r\n\r\n\t\tvar setImgSlider = function () {\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\tfor (var i = 0; i < pathSlide.length; i++) {\r\n\t\t\t\t\tvar img = document.createElement('img');\r\n\t\t\t\t\timg.setAttribute('src', pathSlide[i]);\r\n\t\t\t\t\timg.classList.add('slide');\r\n\t\t\t\t\tdocument.getElementById('slider').appendChild(img);\r\n\t\t\t\t}\r\n\t\t\t\tresolve('Réussite');\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tsetImgSlider().then(launchSlide);\r\n\t},\r\n\r\n\t///\r\n\t/// initialisation des functions\r\n\t///\r\n\tinit() {\r\n\t\tMediaBox('.mediabox');\r\n\r\n\t\tsettings.slidesTempsForts && slideFestival('is-tempsforts', 'prev', 'f-button--next');\r\n\r\n\t\tif (x >= 1024 && settings.slides != undefined) {\r\n\t\t\tthis.slider();\r\n\t\t}\r\n\r\n\t\tvar bandeAnnonce = getParams(window.location.href);\r\n\r\n\t\tif (typeof bandeAnnonce.video != 'undefined') {\r\n\t\t\tvar someLink = document.querySelector('.mediabox');\r\n\t\t\tsimulateClick(someLink);\r\n\t\t}\r\n\r\n\t}\r\n}\r\n\r\n///\r\n/// Pages film\r\n///\r\nvar pageFilms = {\r\n\t///\r\n\t/// initialisation des functions\r\n\t///\r\n\tinit() {\r\n\r\n\t\tMediaBox('.mediabox');\r\n\r\n\t\tif (document.referrer === window.origin + '/festival-objectif-aventure/programme') {\r\n\t\t\tvar retour = document.querySelector('.f-retour a');\r\n\t\t\tretour.setAttribute('href', 'javascript:history.back()');\r\n\t\t}\r\n\r\n\r\n\t\tif (document.body.style.getPropertyValue('--color-film-primary') == '') {\r\n\t\t\tdocument.body.style.setProperty('--color-film-primary', '#2778c9');\r\n\t\t}\r\n\r\n\t\t/// Slider\r\n\t\tx >= 1024 && slideFestival('slides', 'prev', 'next');\r\n\t}\r\n}\r\n\r\n///\r\n/// Filtres\r\n///\r\nvar filtrerProgramme = {\r\n\t///\r\n\t/// Variables\r\n\t///\r\n\tinfosFilms: [],\r\n\titems: document.getElementsByClassName('f-programme__event'),\r\n\tfiltered: {},\r\n\tfiltered_json: '',\r\n\t///\r\n\t/// On remplit le tableau des événements avec les infos data\r\n\t/// Utile ?\r\n\tpushData() {\r\n\t\tfor (var i = 0; i < this.items.length; i++) {\r\n\r\n\t\t\tthis.items[i].setAttribute('id', 'event-' + i);\r\n\r\n\t\t\tvar id = 'event-' + i,\r\n\t\t\t\ttitre = this.items[i].querySelector('h3').innerHTML,\r\n\t\t\t\tjour = this.items[i].getAttribute('data-jour'),\r\n\t\t\t\ttheme = this.items[i].getAttribute('data-theme'),\r\n\t\t\t\tsalle = this.items[i].getAttribute('data-salle'),\r\n\t\t\t\tinfoFilm = {\r\n\t\t\t\t\tid: id,\r\n\t\t\t\t\ttitre: titre,\r\n\t\t\t\t\tjour: jour,\r\n\t\t\t\t\ttheme: theme,\r\n\t\t\t\t\tsalle: salle\r\n\t\t\t\t};\r\n\r\n\t\t\tthis.infosFilms.push(infoFilm);\r\n\t\t}\r\n\t},\r\n\t///\r\n\t/// Function Reset filters\r\n\t///\r\n\tresetFilters() {\r\n\t\t!document.getElementById('alldays') === null && document.getElementById('alldays').setAttribute('checked', 'checked');\r\n\t\t!document.getElementById('allthemes') === null && document.getElementById('allthemes').setAttribute('checked', 'checked');\r\n\t},\r\n\t///\r\n\t/// Si window.widht() < 769, on ajoute une classe\r\n\t///\r\n\tmobile() {\r\n\t\tif (x < 1024) {\r\n\r\n\t\t\tdocument.getElementById('modalJours') !== null && document.getElementById('modalJours').classList.add('modal');\r\n\t\t\tdocument.getElementById('modalThemes') !== null && document.getElementById('modalThemes').classList.add('modal');\r\n\t\t}\r\n\t},\r\n\t///\r\n\t/// Function d'application des filtres\r\n\t/// Evt : click sur '.filtre'\r\n\t/// On récupère l'objet filtre et on boucle sur les items pour les afficher ou pas\r\n\t///\r\n\tfilterFn(a) {\r\n\t\tfor (var i = 0; i < this.items.length; i++) {\r\n\t\t\t// on affiche tous les éléments\r\n\t\t\tthis.items[i].classList.remove('hidden');\r\n\r\n\t\t\tvar filtresActifs = a;\r\n\r\n\t\t\t/// si tous les jours est sélectionné, on filtre sur les thèmes\r\n\t\t\tif (filtresActifs.jour === 'alldays' && filtresActifs.theme === 'allthemes') {\r\n\t\t\t\tthis.items[i].classList.remove('hidden');\r\n\t\t\t} else if (filtresActifs.jour === 'alldays') {\r\n\t\t\t\tif (this.items[i].getAttribute('data-theme') === filtresActifs.theme) {\r\n\t\t\t\t\tthis.items[i].classList.remove('hidden');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.items[i].classList.add('hidden');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/// si tous les thèmes est sélectionné, on filtre sur les jour\r\n\t\t\telse if (filtresActifs.theme === 'allthemes') {\r\n\t\t\t\tif (this.items[i].getAttribute('data-jour') === filtresActifs.jour) {\r\n\t\t\t\t\tthis.items[i].classList.remove('hidden');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.items[i].classList.add('hidden');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/// si non on filtre sur les deux\r\n\t\t\telse {\r\n\t\t\t\tif (this.items[i].getAttribute('data-jour') === filtresActifs.jour && this.items[i].getAttribute('data-theme') === filtresActifs.theme) {\r\n\t\t\t\t\tthis.items[i].classList.remove('hidden');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.items[i].classList.add('hidden');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/// Gestion nom des jours\r\n\t\tvar testJour = filtresActifs.jour,\r\n\t\t\ttestTheme = filtresActifs.theme,\r\n\t\t\tsectionIdV = document.getElementById('jourvendredi'),\r\n\t\t\tsectionIdS = document.getElementById('joursamedi'),\r\n\t\t\tsectionIdD = document.getElementById('jourdimanche'),\r\n\t\t\tsections = document.querySelectorAll('section');\r\n\r\n\t\t/// Lorsque l'on filtre, on affiche tous les jours au départ\r\n\t\tArray.prototype.forEach.call(sections, function (el, i) {\r\n\t\t\tel.classList.add('hidden');\r\n\t\t});\r\n\r\n\t\t/// Par défaut les input radio sont enabled\r\n\t\tvar radiosJour = document.getElementsByName('jourFiltre');\r\n\t\tvar radiosTheme = document.getElementsByName('themeFiltre');\r\n\t\tfor (var i = 0, length = radiosJour.length; i < length; i++) {\r\n\t\t\tradiosJour[i].removeAttribute('disabled');\r\n\t\t}\r\n\t\tfor (var i = 0, length = radiosTheme.length; i < length; i++) {\r\n\t\t\tradiosTheme[i].removeAttribute('disabled');\r\n\t\t}\r\n\r\n\t\tswitch (testJour) {\r\n\t\tcase 'vendredi':\r\n\t\t\tsectionIdV.classList.remove('hidden');\r\n\t\t\tsectionIdS.classList.add('hidden');\r\n\t\t\tsectionIdD.classList.add('hidden');\r\n\t\t\tbreak;\r\n\t\tcase 'samedi':\r\n\t\t\tsectionIdV.classList.add('hidden');\r\n\t\t\tsectionIdS.classList.remove('hidden');\r\n\t\t\tsectionIdD.classList.add('hidden');\r\n\t\t\tdocument.getElementById('rencontre').setAttribute('disabled', 'disabled');\r\n\t\t\tbreak;\r\n\t\tcase 'dimanche':\r\n\t\t\tsectionIdV.classList.add('hidden');\r\n\t\t\tsectionIdS.classList.add('hidden');\r\n\t\t\tsectionIdD.classList.remove('hidden');\r\n\t\t\tdocument.getElementById('tempsForts').setAttribute('disabled', 'disabled');\r\n\t\t\tbreak;\r\n\t\tcase 'alldays':\r\n\t\t\tArray.prototype.forEach.call(sections, function (el, i) {\r\n\t\t\t\tel.classList.remove('hidden');\r\n\t\t\t});\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tswitch (testTheme) {\r\n\t\tcase 'rencontre':\r\n\t\t\tdocument.getElementById('samedi').setAttribute('disabled', 'disabled');\r\n\r\n\t\t\tif (['vendredi', 'samedi', 'dimanche'].includes(testJour)) {\r\n\t\t\t\tdocument.getElementById(`jour${testJour}`).classList.remove('hidden');\r\n\t\t\t} else {\r\n\t\t\t\tsectionIdV.classList.remove('hidden');\r\n\t\t\t\tsectionIdS.classList.add('hidden');\r\n\t\t\t\tsectionIdD.classList.remove('hidden');\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 'dedicaces':\r\n\t\tcase 'Film':\r\n\t\t\tif (['vendredi', 'samedi', 'dimanche'].includes(testJour)) {\r\n\t\t\t\tdocument.getElementById(`jour${testJour}`).classList.remove('hidden');\r\n\t\t\t} else {\r\n\t\t\t\tsectionIdV.classList.remove('hidden');\r\n\t\t\t\tsectionIdS.classList.remove('hidden');\r\n\t\t\t\tsectionIdD.classList.remove('hidden');\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 'tempsForts':\r\n\t\t\tdocument.getElementById('dimanche').setAttribute('disabled', 'disabled');\r\n\r\n\t\t\tif (['vendredi', 'samedi', 'dimanche'].includes(testJour)) {\r\n\t\t\t\tdocument.getElementById(`jour${testJour}`).classList.remove('hidden');\r\n\t\t\t} else {\r\n\t\t\t\tsectionIdV.classList.remove('hidden');\r\n\t\t\t\tsectionIdS.classList.remove('hidden');\r\n\t\t\t\tsectionIdD.classList.add('hidden');\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t},\r\n\t///\r\n\t/// Gestion du local storage : garder les filtres en mémoire\r\n\t///\r\n\tstorageFilters() {\r\n\t\tif (typeof localStorage != 'undefined') {\r\n\t\t\tvar festivalFiltre = localStorage.getItem('festivalFiltre2023');\r\n\r\n\t\t\tif (festivalFiltre != null) {\r\n\t\t\t\tthis.filtered = festivalFiltre === 'undefined' ? {\r\n\t\t\t\t\tjour: 'alldays',\r\n\t\t\t\t\ttheme: 'allthemes'\r\n\t\t\t\t} : {\r\n\t\t\t\t\tjour: festivalFiltre.jour,\r\n\t\t\t\t\ttheme: festivalFiltre.theme\r\n\t\t\t\t};\r\n\t\t\t\tvar getSessionStorageObj = JSON.parse(localStorage.getItem('festivalFiltre2023'));\r\n\t\t\t\tthis.filterFn(getSessionStorageObj);\r\n\t\t\t\t/// Au load, on coche soit selon la sessionStorage, soit allDay et allThemes\r\n\t\t\t\tdocument.getElementById(getSessionStorageObj.jour).setAttribute('checked', 'checked');\r\n\t\t\t\tdocument.getElementById(getSessionStorageObj.theme).setAttribute('checked', 'checked');\r\n\t\t\t} else {\r\n\t\t\t\tthis.resetFilters();\r\n\t\t\t\tthis.filtered = {\r\n\t\t\t\t\tjour: 'alldays',\r\n\t\t\t\t\ttheme: 'allthemes'\r\n\t\t\t\t};\r\n\t\t\t\tthis.filtered_json = JSON.stringify(this.filtered);\r\n\t\t\t\tlocalStorage.setItem('festivalFiltre2023', this.filtered_json);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfiltered = {\r\n\t\t\t\tjour: 'alldays',\r\n\t\t\t\ttheme: 'allthemes'\r\n\t\t\t};\r\n\t\t\tthis.resetFilters();\r\n\t\t}\r\n\t},\r\n\t///\r\n\t/// Evenement filtre\r\n\t///\r\n\tjefiltre(a) {\r\n\t\tdocument.addEventListener('click', function (event) {\r\n\t\t\tvar type = '';\r\n\r\n\t\t\t// Si l'élément cliqué ne possède pas l'attribut [data-type], on ne fait rien\r\n\t\t\tif (!event.target.hasAttribute('data-type')) return;\r\n\r\n\t\t\ttype = event.target.getAttribute('data-type') === 'theme' ? 'data-theme' : 'data-jour';\r\n\r\n\t\t\tif (event.target.getAttribute('data-type') === 'theme') {\r\n\t\t\t\ta.theme = event.target.id;\r\n\t\t\t\tvar e = document.getElementsByName('jourFiltre');\r\n\t\t\t\tfor (var i = 0; i < e.length; i++) {\r\n\t\t\t\t\tif (e[i].checked) {\r\n\t\t\t\t\t\ta.jour = e[i].id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ta.jour = event.target.id;\r\n\t\t\t\tvar e = document.getElementsByName('themeFiltre');\r\n\t\t\t\tfor (var i = 0; i < e.length; i++) {\r\n\t\t\t\t\tif (e[i].checked) {\r\n\t\t\t\t\t\ta.theme = e[i].id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar filtered_json = JSON.stringify(a);\r\n\t\t\tlocalStorage.setItem('festivalFiltre2023', filtered_json);\r\n\t\t\tfiltrerProgramme.filterFn(a);\r\n\r\n\t\t\t///\r\n\t\t\t/// Sur mobile on change le libelle du lien modal\r\n\t\t\tif (x < 1024) {\r\n\t\t\t\tvar libelleMobileTheme = a.theme;\r\n\t\t\t\tvar libelleMobileJour = a.jour;\r\n\t\t\t\tlibelleMobileTheme = libelleMobileTheme === 'allthemes' ? 'thèmes' : libelleMobileTheme;\r\n\t\t\t\tlibelleMobileTheme = libelleMobileTheme === 'tempsForts' ? 'temps forts' : libelleMobileTheme;\r\n\t\t\t\tlibelleMobileJour = libelleMobileJour === 'alldays' ? 'jours' : libelleMobileJour;\r\n\r\n\t\t\t\tdocument.getElementById('showResultatsThemes').addEventListener('click', function () {\r\n\t\t\t\t\tdocument.getElementById('labelMobileTheme').innerHTML = libelleMobileTheme;\r\n\t\t\t\t\tdocument.getElementById('modal-2').checked = false;\r\n\t\t\t\t});\r\n\t\t\t\tdocument.getElementById('showResultatsJours').addEventListener('click', function () {\r\n\t\t\t\t\tdocument.getElementById('labelMobileJour').innerHTML = libelleMobileJour;\r\n\t\t\t\t\tdocument.getElementById('modal-1').checked = false;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\t///\r\n\t/// Show plan 104\r\n\t///\r\n\tshowPlan() {\r\n\t\tbaguetteBox.run('.f-card__description', {\r\n\t\t\tanimation: 'fadeIn',\r\n\t\t\tnoScrollbars: true\r\n\t\t});\r\n\t},\r\n\t///\r\n\t/// initialisation des functions\r\n\t///\r\n\tinit() {\r\n\t\tthis.mobile();\r\n\t\tthis.storageFilters();\r\n\t\tthis.showPlan();\r\n\t\tthis.jefiltre(filtrerProgramme.filtered);\r\n\t}\r\n}\r\n\r\n///\r\n/// Page jury - prix du public\r\n///\r\n/*var jury = {\r\n\tipUser: '',\r\n\turlVote: settings.urlVote,\r\n\ttestVote: false,\r\n\t///\r\n\t/// Check ip du visiteur\r\n\t///\r\n\twhatIp() {\r\n\t\tvar request = new XMLHttpRequest();\r\n\t\trequest.open('GET', '//api.ipify.org?format=json', true);\r\n\r\n\t\trequest.onload = function() {\r\n\t\t if (request.status >= 200 && request.status < 400) {\r\n\t\t var data = JSON.parse(request.responseText);\r\n\t\t } else {\r\n\t\t //return this.ipUser = null;\r\n\t\t }\r\n\t\t return data.ip;\r\n\t\t};\r\n\r\n\t\trequest.onerror = function() {\r\n\t\t\t//return this.ipUser = null;\r\n\t\t};\r\n\t\trequest.send();\r\n\t},\r\n\t///\r\n\t/// getinfo\r\n\t///\r\n\tsetinfo(id, libelle, ip) {\r\n\t\tvar data = { id: id, libelle: libelle, ip: ip};\r\n\t\t//console.log(data);\r\n\t\t//var request = new XMLHttpRequest();\r\n\t\t//request.open('POST', this.urlVote, true);\r\n\t\t//request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\r\n\t\t//request.send(data);\r\n\t},\r\n\t///\r\n\t/// On vérifie si l'utilisateur a déjà voté\r\n\t///\r\n\tcheckIfAlreadyVote() {\r\n\t\tthis.whatIp();\r\n\t\t//var myIp = this.ipUser;\r\n\t\tconsole.info(jury.whatIp())\r\n\t\t/// @todo tester si ip déjà voté\r\n\r\n\t\tvar vote = false || localStorage.getItem('festivalVote');\r\n\r\n\t\treturn vote;\r\n\t},\r\n\t///\r\n\t/// Click sur btn vote\r\n\t///\r\n\tclickBtnPrixPublic() {\r\n\t\t// On vérifie si l'ip a déjà voté : true | false\r\n\t\ttestVote = this.checkIfAlreadyVote();\r\n\t\tthis.whatIp();\r\n\t\tconsole.info(jury.ipUser)\r\n\t\tconsole.info(testVote)\r\n\t\tdocument.getElementById('labelPrixPublic').addEventListener('click', function(event) {\r\n\t\t\t// soit non, alors on lance la modale de vote\r\n\t\t\tif(testVote === null || testVote === 'undefined' || testVote === false) {\r\n\t\t\t\tdocument.body.classList.add('has-modal');\r\n\t\t\t\tvar votePublic = '';\r\n\t\t\t\tvar films = document.getElementsByName('votepublic');\r\n\r\n\t\t\t\tdocument.getElementById('submit').addEventListener('click', function(ev) {\r\n\r\n\t\t\t\t\tfor(var i = 0; i < films.length; i++) {\r\n\t\t\t\t\t\tif(films[i].checked) votePublic = films[i].nextElementSibling.innerHTML.trim(); \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tjury.setinfo(1, votePublic, ip);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// On affiche un message\r\n\t\t\t\t\tdocument.getElementById('contentModal').innerHTML = 'Merci, votre vote a été pris en compte';\r\n\t\t\t\t\t// On ferme la modale après un laps de temps\r\n\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t document.getElementById('modalPrixPublic').checked = false;\r\n\t\t\t\t }, 5000);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// on met une valeur pour empêcher de votez une seconde fois\r\n\t\t\t\t\tlocalStorage.setItem('festivalVote',true);\r\n\t\t\t\t\ttestVote = true;\r\n\t\t\t\t});\r\n\r\n\t\t\t} \r\n\t\t\t// soit oui, alors on affiche le message d'alerte\r\n\t\t\telse {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\tjury.alertMsg();\r\n\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t document.getElementById('alert').classList.add('hidden');\r\n\t\t\t\t }, 5000);\r\n\t\t\t}\r\n\t\t});\r\n\t},\r\n\t///\r\n\t/// Message alerte si utilisateur a déjà voté\r\n\t///\r\n\talertMsg() {\r\n\t\tvar alertId = document.getElementById('alert');\r\n\t\talertId.classList.remove('hidden');\r\n\r\n\t\t//alertId.querySelectorAll('a').innerHtml = a;\r\n\t\t\r\n\t\tfunction hideAlert() {\r\n\t\t\talertId.classList.add('hidden');\r\n\t\t}\r\n\t\t\r\n\t\talertId.addEventListener('click', function(ev) {\r\n\t\t\tev.preventDefault();\r\n\t\t\thideAlert();\r\n\t\t});\r\n\t},\r\n\t///\r\n\t/// initialisation des functions\r\n\t///\r\n\tinit() {\r\n\t\tthis.checkIfAlreadyVote();\r\n\t}\r\n}*/\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n\r\n\tmain.init();\r\n\r\n\tif (settings != 'undefined') {\r\n\t\tvar page = settings.page;\r\n\t\tswitch (page) {\r\n\t\tcase 'home':\r\n\t\t\thome.init();\r\n\t\t\tbreak;\r\n\t\tcase 'bivouac':\r\n\t\t\tbgHero();\r\n\t\t\tbreak;\r\n\t\tcase 'film':\r\n\t\t\tbgHero();\r\n\t\t\tpageFilms.init();\r\n\t\t\tbreak;\r\n\t\tcase 'programmation':\r\n\t\t\tfiltrerProgramme.init();\r\n\t\t\tbreak;\r\n\t\t\t/*case 'prixjury':\r\n\t\t\t\tjury.init();\r\n\t\t\t\tbreak;*/\r\n\t\tcase 'librairie':\r\n\t\t\tbgHero();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n});"]}