1 2 3document.addEventListener('DOMContentLoaded', function() { 4 5 var header = document.querySelector('header') 6 var menu = document.querySelector('header nav.menu') 7 8 menuxs() 9 scroll() 10 photos() 11 search() 12 13 // alert("Ok") 14 15 /*$("a").each(function () { 16 if (this.href.indexOf('https://beta-business.abidjan.net') != -1) { 17 this.href = this.href.replace('https://beta-business.abidjan.net', 'https://business.abidjan.net'); 18 } else if (this.href.indexOf('https://beta-news.abidjan.net') != -1) { 19 this.href = this.href.replace('https://beta-news.abidjan.net', 'https://news.abidjan.net'); 20 }else if (this.href.indexOf('https://beta.abidjan.net') != -1) { 21 this.href = this.href.replace('https://beta.abidjan.net', 'https://www.abidjan.net'); 22 }else if (this.href.indexOf('https://beta-necrologie.abidjan.net') != -1) { 23 this.href = this.href.replace('https://beta-necrologie.abidjan.net', 'https://necrologie.abidjan.net'); 24 }else if (this.href.indexOf('https://beta-sports.abidjan.net') != -1) { 25 this.href = this.href.replace('https://beta-sports.abidjan.net', 'https://sports.abidjan.net'); 26 } 27 }); 28 $("link").each(function () { 29 if (this.href.indexOf('/public') != -1) { 30 this.href = this.href.replace('/public', 'https://beta-news.abidjan.net/public'); 31 } 32 });*/ 33 34 35 // Search 36 // _____________________________ 37 38 function search() { 39 40 searchBtn = document.getElementById('btnSearch') 41 searchBloc = document.getElementById('blocSearch') 42 43 searchBtn.addEventListener('click', function(e) { 44 45 e.preventDefault() 46 47 if (searchBtn.classList.contains('on')) { 48 49 searchBloc.classList.remove('show') 50 searchBtn.classList.remove('on') 51 52 } else { 53 54 searchBloc.classList.add('show') 55 searchBtn.classList.add('on') 56 57 searchBloc.querySelector('input').focus() 58 59 } 60 61 }) 62 63 } 64 65 66 // Menu Mobile 67 // _____________________________ 68 69 function menuxs() { 70 71 menuburger = document.querySelector('.menu-xs') 72 73 menuburger.addEventListener('click', function() { 74 75 if (menuburger.classList.contains('on')) { 76 77 menu.classList.remove('show') 78 menuburger.classList.remove('on') 79 80 } else { 81 82 menu.classList.add('show') 83 menuburger.classList.add('on') 84 85 } 86 87 }) 88 89 if(isXS()||isSM()) { 90 91 var links = document.querySelectorAll('header nav.menu span > a') 92 Array.prototype.forEach.call(links, function(link, i) { 93 // console.log(i) 94 link.addEventListener('click', function(e){ 95 e.preventDefault() 96 let parent = link.parentNode 97 if (parent.classList.contains('on')) { 98 parent.classList.remove('on') 99 } else { 100 parent.classList.add('on') 101 } 102 }) 103 }) 104 105 } 106 107 } 108 109 110 111 // On affiche le mini-header au scroll 112 // ________________________________________ 113 114 function scroll() { 115 116 document.body.onscroll = function() { 117 118 st = window.pageYOffset | document.body.scrollTop 119 120 mini = (st>50) ? header.classList.add('mini') : header.classList.remove('mini') 121 122 /*const divSlimBanner = document.getElementById("divSlimBanner").classList; 123 hideDiv = (st>50) ? divSlimBanner.add("hideDiv") : divSlimBanner.remove("hideDiv");*/ 124 const hideDiv = document.querySelector('.banner-full-with'); 125 //hideDiv.classList.add('hideDiv'); 126 if(st>50){hideDiv.classList.add('hideDiv');}else{hideDiv.classList.remove('hideDiv');} 127 //soda.classList.add('diet', 'cherry'); 128 129 130 } 131 132 133 } 134 135 136 // Affichage de toutes les photos (page Article) 137 // ____________________________________________________ 138 139 function photos() { 140 141 if (document.getElementById('allPhotos')) { 142 143 btn = document.getElementById('btnPhotos') 144 all = document.getElementById('allPhotos') 145 146 btn.addEventListener('click', function(e) { 147 148 e.preventDefault() 149 all.classList.add('show') 150 151 }) 152 153 all.addEventListener('click', function(e) { 154 155 all.classList.remove('show') 156 157 }) 158 159 } 160 161 } 162 163 164 165 // Fonctions responsive 166 // ____________________________________________________ 167 168 function isXS() { 169 170 element = document.getElementById('chck-xs') 171 retour = element.currentStyle ? element.currentStyle.display : getComputedStyle(element, null).display 172 return ( retour == 'block' ) 173 174 } 175 176 function isSM() { 177 178 element = document.getElementById('chck-sm') 179 retour = element.currentStyle ? element.currentStyle.display : getComputedStyle(element, null).display 180 return ( retour == 'block' ) 181 182 } 183 184})
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.