1 2(function($) { 3 $(document).ready(function($) { 4 $(document).TCScroll(); 5 $(document).TCTabs(); 6 $(document).TCAccordeon(); 7 8 $('.autoheight-row').TCAutoHeight(); 9 }); 10})(jQuery); 11(function($) { 12 $(document).ready(function($) { 13 /** 14 * Click des lien contenant un #c pour les liens de tt_content 15 */ 16 $("a[href*='#c']").click(function() { 17 window.location.hash = $(this).attr("href").split("#")[1]; 18 19 if ($('.tabbable').find('.tab-pane').length > 0 && typeof TCTabs != 'undefined') { 20 if (TCTabs.openTab()) return false; 21 } 22 23 if ($('.panel-group').length > 0 && typeof TCAccordeon != 'undefined') { 24 if (TCAccordeon.openAccordeon()) return false; 25 } 26 }); 27 }); 28})(jQuery); 29$(document).ready(function($) { 30 $('.tx-ceg-bibliobus').Bibliobus(); 31}); 32// Parsley error class overrides for Bootstrap 33window.Parsley.on('field:error', function() { 34 this.$element.closest('.powermail_field').addClass('has-error'); 35}); 36window.Parsley.on('field:success', function() { 37 this.$element.closest('.powermail_field').removeClass('has-error'); 38}); 39 40// recaptcha 41window.Parsley.on('form:submit', function() { 42 if (grecaptcha.getResponse() === '') { 43 // validate recaptcha 44 grecaptcha.execute(); 45 46 // stop parsley so the form is not submitted 47 return false; 48 } 49}); 50 51function onFormSubmit(token) { 52 // search for form with this token defined 53 $('form').each(function() { 54 var $form = $(this); 55 if ($form.find('#g-recaptcha-response').length > 0 && $form.find('#g-recaptcha-response').val() === token) { 56 $form.submit(); 57 } 58 }); 59} 60$(document).ready(function () { 61 // AFFICHAGE ALEATOIRE + DIAPORAMA SUR L'IMAGE DE FOND 62 function setBackground() { 63 // AFFICHAGE ALEATOIRE DU BANDEAU
64 // Declaration d'un nouveau tableau contenant les noms d'images 65 var img = new Array() 66 img[0] = "fileadmin/bibliobus/images/slider-home/biblio-bg-1.jpg"; 67 img[1] = "fileadmin/bibliobus/images/slider-home/biblio-bg-2.jpg"; 68 img[2] = "fileadmin/bibliobus/images/slider-home/biblio-bg-3.jpg"; 69 //img[2] = "fileadmin/sites/nomad/system/img/image3.jpg"; 70 //img[3] = "fileadmin/sites/nomad/system/img/image4.jpg"; 71 //img[4] = "fileadmin/sites/nomad/system/img/image5.jpg"; 72 //img[5] = "fileadmin/sites/nomad/system/img/image6.jpg"; 73 //img[6] = "fileadmin/sites/nomad/system/img/image7.jpg"; 74 //img[7] = "fileadmin/sites/nomad/system/img/image8.jpg"; 75 //img[8] = "fileadmin/sites/nomad/system/img/image9.jpg"; 76 //img[9] = "fileadmin/sites/nomad/system/img/image10.jpg"; 77 78 //On cherche une valeur aleatoire en fonction de la dimension du tableau 79 var rnd = Math.round(Math.random() * (img.length - 1)); 80 81 // on applique le background sur la div ayant l'id arriereplan 82 $('.slider-home').css('background', 'url(/' + img[rnd] + ') center center no-repeat'); 83 84 85 86 setTimeout(function () { 87 setBackground(); 88 }, 50000); 89 90 } 91 92 setBackground(); 93 94}); 95(function($) { 96 $(function() { 97 $('.jcarousel').jcarousel(); 98 99 $('.jcarousel-control-prev') 100 .on('jcarouselcontrol:active', function() { 101 $(this).removeClass('inactive'); 102 }) 103 .on('jcarouselcontrol:inactive', function() { 104 $(this).addClass('inactive'); 105 }) 106 .jcarouselControl({ 107 target: '-=1' 108 }); 109 110 $('.jcarousel-control-next') 111 .on('jcarouselcontrol:active', function() { 112 $(this).removeClass('inactive'); 113 }) 114 .on('jcarouselcontrol:inactive', function() { 115 $(this).addClass('inactive'); 116 }) 117 .jcarouselControl({ 118 target: '+=1' 119 }); 120 121 $('.jcarousel-pagination') 122 .on('jcarouselpagination:active', 'a', function() { 123 $(this).addClass('active'); 124 }) 125 .on('jcarouselpagination:inactive', 'a', function() { 126 $(this).removeClass('active'); 127 }) 128 .jcarouselPagination(); 129 }); 130})(jQuery); 131$(document).ready(function ($) { 132 133// Suppression du lien du 1er élément de menu 134 135 $("li.category-vivre > a").removeAttr('href'); 136 137// Affichage du menu hover contact 138 139 $(".head-contact").hover( 140 function() { 141 $('.menu-contact').show(); 142 }, function() { 143 $('.menu-contact').hide(); 144 } 145 ); 146 147 148 149 150 151 152 153// Popup pour les question 154// Boucle sur chaque question puis envoie le contenu de la réponse dans la popup 155 156 $('.open-popup-link').each(function (i, elem) { 157 var vSrc = $(elem).next(); 158 $(elem).magnificPopup({ 159 items: { 160 src: vSrc, 161 type: 'inline' 162 } 163 }); 164 }); 165 166 167 /* Gestion du ticker */ 168 $("div.ticker span.close").on("click", function () { 169 $(this).parent("div.ticker").fadeOut(); 170 $(".tc_website_ticker").addClass("close-ticker"); 171 createCookie("bibliobusTicker", $("span.textticker").html(), 1); 172 }); 173 174 var cookie = readCookie("bibliobusTicker"); 175 176 if (cookie !== $("span.textticker").html()) { 177 178 $("div.ticker").fadeIn(); 179 } 180 181 /* Gestion des cookies */ 182 function createCookie(name, value, days) { 183 if (days) { 184 var date = new Date(); 185 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); 186 var expires = "; expires=" + date.toGMTString(); 187 } 188 else var expires = ""; 189 document.cookie = name + "=" + value + expires + "; path=/"; 190 } 191 192 function readCookie(name) { 193 var nameEQ = name + "="; 194 var ca = document.cookie.split(';'); 195 for (var i = 0; i < ca.length; i++) { 196 var c = ca[i]; 197 while (c.charAt(0) == ' ') c = c.substring(1, c.length); 198 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); 199 } 200 return null; 201 } 202 203 204
205// Galeries d'images Royal Slider 206 $('.royalSlider').TCSlider(); 207 208// go to top button 209 $('.toTop').TCToTop(); 210 211 // images lightbox 212 $(document).ready(function() { 213 $('.lightbox').magnificPopup({type:'image'}); 214 }); 215 216// accordion 217 $('.panel-collapse').TCAccordion(); 218 219// float labels 220 $('.tx-powermail input, .tx-powermail textarea').TCFloatLabels(); 221 222// message if browser is outdated 223 $(window).TCjReject(); 224 225// images lazyload 226 $('img[data-original]').lazyload({ 227 effect: "fadeIn" 228 }); 229 230// link handler (external links open in new tab/windows) 231 $('a').TCLinkHandler(); 232 233// auto-scroll to element from url hash 234 $('a').TCScrollToElement(); 235 236// main superfish menu 237 $('ul.sf-menu').superfish({ 238 delay: 0, // the delay in milliseconds that the mouse can remain outside a submenu without it closing 239 disableHI: true, // set to true to disable hoverIntent detection 240 //cssArrows: false, // set to false if you want to remove the CSS-based arrow triangles 241 //pathClass: 'current' 242 }); 243 244// main mobile menu 245 /** Gestion du menu mobile **/ 246 $('#mobileMenu').mmenu({ 247 248 }); 249 250}); 251 252// external js: isotope.pkgd.js 253$(document).ready(function ($) { 254 255 256// init Isotope 257var $grid = $('.grid').isotope({ 258 itemSelector: '.element-item', 259 layoutMode : 'fitRows', 260 getSortData: { 261 date: '.date parseInt' 262 }, 263 264 sortAscending: true 265}); 266var filters = {}; 267var $grid2 = $('.grid2').isotope({ 268 itemSelector: '.element-item' 269}); 270 271// bind filter button click 272$('#filters').on( 'click', 'button', function() { 273 var filterValue = $( this ).attr('data-filter'); 274 var sortValue = $(this).attr('data-sort-by'); 275 // use filterFn if matches value 276 $grid.isotope({ filter: filterValue, sortBy: sortValue }); 277 //$grid.isotope({ sortBy: sortValue,sortAscending: false}); 278 279}); 280 281// bind filter button click 282 $('.filter-select').on( 'change', function(e) { 283 284 // get group key 285 var filterGroup = $(this).attr('value-group'); 286 // set filter for group 287 var val=e.target.value; 288 filters[ filterGroup ] = val; 289 // combine filters 290 var filterValue = concatValues( filters ); 291 // use filterFn if matches value 292 $grid2.isotope({ filter: filterValue }); 293 }); 294 295// change is-checked class on buttons 296$('.button-group').each( function( i, buttonGroup ) { 297 var $buttonGroup = $( buttonGroup ); 298 $buttonGroup.on( 'click', 'li', function() { 299 $buttonGroup.find('.is-checked').removeClass('is-checked'); 300 $( this ).addClass('is-checked'); 301 }); 302}); 303 304// flatten object by concatting values 305 function concatValues( obj ) { 306 var value = ''; 307 for ( var prop in obj ) { 308 value += obj[ prop ]; 309 } 310 return value; 311 } 312 313}); 314var GDPR = { 315 useGoogleAnalytics: false, 316 useWysistat: false, 317 318 cookiebarBackgroundColor: '#ed5a2e', 319 cookiebarTextColor: '#ffffff', 320 cookiebarButtonBackgroundColor: '#eeeeee', 321 cookiebarPrivacyPageRelativeUrl: '/menu-principal/decouvrir-le-bibliobus/en-pratique/mentions-legales/', 322 323 removeAlliFrame: true, 324 325 cookiebarShowChangeMyMind: true, 326 327 GACode: '', 328 wysistatCode: 'ceg_ext_bibliobus' 329}; 330GDPR.handle = function () { 331 332 /** 333 * Ajout d'un script dynamiquement 334 * @param filepath "Chemin" vers le script 335 * @param callback Fonction appellée suite au chargement du script 336 */ 337 var addScript = function (filepath, callback) { 338 if (filepath) { 339 var fileref = document.createElement('script'); 340 var done = false; 341 var head = document.getElementsByTagName("head")[0]; 342 343 fileref.onload = fileref.onreadystatechange = function () { 344 if (!done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) { 345 done = true; 346 347 callback(); 348 349 // Handle memory leak in IE 350 fileref.onload = fileref.onreadystatechange = null; 351 if (head && fileref.parentNode) { 352 head.removeChild(fileref); 353 } 354 } 355 }; 356 357 fileref.setAttribute("type", "text/javascript"); 358 fileref.setAttribute("src", filepath); 359 360 head.appendChild(fileref); 361 } 362 }; 363 364 var lauchWysistat = function () { 365 366 var path = window.location.pathname; 367 368 // Ajout dynamique du script de Wysistat: obligatoire de faire ainsi, car 369 // sinon 370 addScript('//webstats.ne.ch/wysistat.js', function () { 371 wysistat(GDPR.wysistatCode, '', '', '', path); 372 }); 373 }; 374 375 /** 376 * Lancement de l'appel à Google Analytics 377 */ 378 var lauchGa = function () { 379 (function (i, s, o, g, r, a, m) { 380 i['GoogleAnalyticsObject'] = r; 381 i[r] = i[r] || function () { 382 (i[r].q = i[r].q || []).push(arguments) 383 }, i[r].l = 1 * new Date(); 384 a = s.createElement(o), 385 m = s.getElementsByTagName(o)[0]; 386 a.async = 1; 387 a.src = g; 388 m.parentNode.insertBefore(a, m) 389 })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); 390 391 // Prod 392 ga('create', GDPR.GACode, 'auto'); 393 394 ga('send', 'pageview'); 395 }; 396 397 /** 398 * Suppression d'un cookie 399 * 400 * @param name 401 */ 402 var deleteCookie = function (name) { 403 404 var hostname = window.location.hostname; 405 var firstPoint = hostname.indexOf('.'); 406 407 // Le nom de domaine mis par GA est du style .neuchatelville.ch, alors qu'on est sur www.neuchatelville.ch 408 var cookieDomain = hostname.substr(firstPoint); 409 410 document.cookie = name + '=; Path=/; Domain=' + cookieDomain + '; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 411 }; 412 413 /** 414 * Suppression des cookies mis précédemment par Google Analytics 415 */ 416 var deleteGaCookies = function () { 417 deleteCookie('_ga'); 418 deleteCookie('_gid'); 419 }; 420 421 /** 422 * Suppession de tous les iFrames, pour les embed Youtube et Facebook 423 */ 424 var removeAlliFrames = function () { 425 var iframes = document.querySelectorAll('iframe'); 426 for (var i = 0; i < iframes.length; i++) { 427 iframes[i].parentNode.removeChild(iframes[i]); 428 } 429 }; 430 431 var _popup; 432 433 /** 434 * Gestion de la "popup" de consentement pour les cookies et tracking 435 */ 436 window.cookieconsent.initialise({ 437 "palette": { 438 "popup": {
439 "background": GDPR.cookiebarBackgroundColor, 440 "text": GDPR.cookiebarTextColor 441 }, 442 "button": { 443 "background": GDPR.cookiebarButtonBackgroundColor 444 } 445 }, 446 "content": { 447 "message": "Nous utilisons des cookies et des outils d'analyse pour améliorer la convivialité du site. Plus d'infos: ", 448 "dismiss": "Accepter et fermer", 449 "deny": "", 450 "link": "Protection des données", 451 "href": GDPR.cookiebarPrivacyPageRelativeUrl, 452 "allow": "Accepter les cookies", 453 }, 454 "type": "opt-out", 455 "revokable": true, 456 "cookie": { 457 "name": "consentGDPR" 458 }, 459 460 /** 461 * Appelé au chargement de la page 462 * @param status 463 */ 464 onInitialise: function (status) { 465 var type = this.options.type; 466 var didConsent = this.hasConsented(); 467 468 if (type === 'opt-in' && didConsent) { 469 //console.log("onInitialize, opt-in enable cookies") 470 } 471 if (type === 'opt-out' && !didConsent) { 472 //console.log("onInitialize, opt-out disable cookies") 473 } 474 475 if (didConsent) { 476 if (GDPR.useGoogleAnalytics) { 477 lauchGa(); 478 } 479 480 if (GDPR.useWysistat) { 481 lauchWysistat(); 482 } 483 484 } else { 485 if (GDPR.removeAlliFrame) { 486 removeAlliFrames(); 487 } 488 } 489 }, 490 491 /** 492 * Appelé au clic sur "J'accepte" ou "Je refuse" 493 * @param status 494 * @param chosenBefore 495 */ 496 onStatusChange: function (status, chosenBefore) { 497 var type = this.options.type; 498 var didConsent = this.hasConsented(); 499 500 if (type === 'opt-in' && didConsent) { 501 //console.log("onStatusChange, opt-in enable cookies") 502 } 503 if (type === 'opt-out' && !didConsent) { 504 // console.log("onStatusChange, opt-out disable cookies") 505 506 deleteGaCookies(); 507 508 if (GDPR.removeAlliFrame) { 509 removeAlliFrames(); 510 } 511 } 512 }, 513 514 onRevokeChoice: function () { 515 var type = this.options.type; 516 if (type === 'opt-in') { 517 //console.log("onRevokeChoice, opt-in disable cookies") 518 } 519 if (type === 'opt-out') { 520 //console.log("onRevokeChoice, opt-out enable cookies") 521 } 522 } 523 }, function (popup) { 524 _popup = popup; 525 526 // open revoke button if user has already answered the consent 527 if (_popup.hasAnswered() && GDPR.cookiebarShowChangeMyMind) { 528 _popup.toggleRevokeButton(true); 529 } 530 }, function (err) { 531 console.error(err); 532 }); 533}; 534 535window.addEventListener("load", function () { 536 if (typeof(GDPR) !== 'undefined') { 537 GDPR.handle() 538 } 539});
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.