281 lines
6.7 KiB
JavaScript
Raw Normal View History

2019-04-05 00:19:26 +02:00
function map() {
2019-04-10 16:38:49 +02:00
var $carte = $('#carte');
if ( $carte.length ) {
2019-04-05 00:19:26 +02:00
2019-04-10 16:38:49 +02:00
var mymap = L.map('carte').setView([44.7365818, 4.9776488], 13);
2019-04-05 00:19:26 +02:00
2019-04-10 16:38:49 +02:00
var greenIcon = L.icon({
iconUrl: '/user/themes/lecampus/images/mappoint.svg',
2019-04-05 00:19:26 +02:00
2019-04-10 16:38:49 +02:00
iconSize: [38, 95], // size of the icon
iconAnchor: [22, 94], // point of the icon which will correspond to marker's location
popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
});
2019-04-05 00:19:26 +02:00
2019-04-10 16:38:49 +02:00
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
id: 'mapbox.streets'
}).addTo(mymap);
2019-04-05 00:19:26 +02:00
2019-06-03 15:22:10 +02:00
L.marker([44.7365818, 4.9776488], {icon: greenIcon}).addTo(mymap);
2019-04-05 00:19:26 +02:00
2019-04-10 16:38:49 +02:00
function onMapClick(e) {
popup
.setLatLng(e.latlng)
.setContent("You clicked the map at " + e.latlng.toString())
.openOn(mymap);
}
mymap.on('click', onMapClick);
}
2019-04-02 19:54:29 +02:00
}
2019-04-05 00:19:26 +02:00
function filteritem() {
2019-05-09 00:26:27 +02:00
var $card = $('.body-wrapper > .card');
2019-04-05 00:19:26 +02:00
var $cat = $('.cat a');
2019-05-09 00:26:27 +02:00
var $img = $('.body-wrapper .img');
2019-04-05 00:19:26 +02:00
2019-04-10 16:38:49 +02:00
$(".filters .btn").click(function(e) {
2019-12-20 11:30:26 +01:00
// e.preventDefault();
2019-04-10 16:38:49 +02:00
var filter = $(this).attr("data-filter");
2019-05-09 00:26:27 +02:00
var self = $('.body-wrapper');
2019-04-10 16:38:49 +02:00
self.masonryFilter({
filter: function () {
if (!filter) return true;
return $(this).attr("data-filter") == filter;
}
});
});
2019-05-09 00:26:27 +02:00
var $grid = $('#archive .body-wrapper, #calendrier .body-wrapper').masonry({
2019-04-08 18:00:38 +02:00
// columnWidth: 200,
2019-04-05 00:19:26 +02:00
itemSelector: '.card',
2019-09-10 17:14:47 +02:00
gutter: 40,
2019-04-05 00:19:26 +02:00
transitionDuration: '0.2s'
});
2019-06-24 19:53:10 +02:00
2019-04-05 00:19:26 +02:00
$grid.imagesLoaded().progress(function() {
$grid.masonry();
});
2019-04-02 19:54:29 +02:00
}
2019-04-05 00:19:26 +02:00
function slide() {
2019-05-09 00:26:27 +02:00
$('.gal').bxSlider({
2019-05-27 17:03:03 +02:00
responsive: true,
2019-05-14 19:59:47 +02:00
infiniteLoop: true,
2019-05-09 00:26:27 +02:00
preloadImages:'visible',
pager:false,
2019-06-04 16:51:57 +02:00
auto:true
2019-04-05 00:19:26 +02:00
});
2019-06-02 18:07:05 +02:00
2019-06-24 19:53:10 +02:00
$('.gal-salles').slidesjs({
width: 800,
height: 533,
navigation: true,
pagination: false
});
2019-06-02 18:07:05 +02:00
2019-04-08 18:00:38 +02:00
}
function links() {
2019-06-19 16:33:20 +02:00
var $a = $('.dropmenu > ul > li > .no-click');
2019-04-08 18:00:38 +02:00
var $map = $('a#carte');
2019-04-09 18:05:36 +02:00
2019-04-08 18:00:38 +02:00
$a.on('click', function(e) {
e.preventDefault();
})
$map.on('click', function(e) {
e.preventDefault();
})
2019-04-05 00:19:26 +02:00
}
2019-04-02 19:54:29 +02:00
2019-05-09 00:26:27 +02:00
function clickbutton() {
2019-06-03 15:22:10 +02:00
var $button = $('#ajax-test-form .radio label');
2019-05-09 00:26:27 +02:00
$button.on('click', function(){
2019-06-03 15:22:10 +02:00
$(this).parents('.form-data').find('.check').removeClass('check');
$(this).parent('.radio').addClass('check');
2019-05-09 00:26:27 +02:00
});
}
function clicksenddevis() {
var $ok = $('.ok');
var $send = $('#send-valide');
$ok.on('click', function () {
$(this).parent('#send-valide').remove();
})
}
function addclass() {
var $map = $('a#carte');
$map.parents('.content_s').addClass('map')
2019-05-14 19:59:47 +02:00
var $reco_click = $('#reco .title');
var $reco_txt = $('#reco .txt');
$reco_click.on('click', function() {
$reco_txt.toggleClass('open');
$(this).toggleClass('open');
2019-06-13 12:45:06 +02:00
$('html, body').animate({scrollTop:$('#reco').position().top}, 'slow');
2019-05-14 19:59:47 +02:00
})
2019-06-05 12:00:17 +02:00
var $out = $('.opt-out .txt');
2019-06-05 12:03:01 +02:00
2019-06-05 12:00:17 +02:00
$out.on('click', function() {
$(this).parent('.opt-out').toggleClass('open');
})
2019-05-09 00:26:27 +02:00
}
2019-05-31 23:37:11 +02:00
function mapsalles() {
var $salles = $('.fond svg path');
var $content = $('.content .content_salle');
arrayid = [];
2019-06-05 12:54:15 +02:00
$('.content .content_salle#salle_trois_becs').css("visibility", "visible");
2019-06-04 16:51:57 +02:00
$('.fond svg path#salle_trois_becs').css("fill", "#0093a3");
2019-05-31 23:37:11 +02:00
2019-06-11 14:08:04 +02:00
$salles.on('click', function(idsalle) {
2019-05-31 23:37:11 +02:00
var idsalle = this.id;
2019-06-09 15:17:49 +02:00
2019-05-31 23:37:11 +02:00
arrayid.push(idsalle);
$salles.css("fill", "white");
$(this).css("fill", "#0093a3");
2019-06-05 12:54:15 +02:00
$('.content .content_salle').css("visibility", "hidden");
$('.content .content_salle#'+arrayid).css("visibility", "visible");
2019-05-31 23:37:11 +02:00
arrayid.length = 0;
});
2019-06-05 12:54:15 +02:00
var $close = $('.content_salle .header-salles img');
$close.on('click', function () {
$(this).parents('.content_salle').css("visibility", "hidden");
2019-06-09 15:17:49 +02:00
$salles.css("fill", "white");
2019-06-05 12:54:15 +02:00
})
2019-05-31 23:37:11 +02:00
};
function burger() {
$('.navTrigger').click(function(){
$(this).toggleClass('active');
$('.dropmenu').toggleClass('active');
});
}
2019-06-07 19:04:55 +02:00
function ajaxformulaire() {
$(".ok").on('click', function () {
$(this).parent('#send-valide').remove();
location.reload();
});
var form = $('#ajax-test-form');
form.submit(function(e) {
// prevent form submission
e.preventDefault();
// submit the form via Ajax
$.ajax({
url: form.attr('action'),
type: form.attr('method'),
dataType: 'html',
data: form.serialize(),
success: function(result) {
// Inject the result in the HTML
$('#form-result').html(result);
}
});
});
}
2019-05-31 23:37:11 +02:00
2021-06-12 14:36:11 +02:00
2021-06-11 16:24:49 +02:00
function open_pack() {
var $pack = $(".nos_pack .pack .__thumb");
var nbrDiv = $pack.length;
var widtWind = $( window ).width();
if(widtWind <= 530){
var count = 1;
} else if (widtWind <= 1024) {
var count = 2;
} else if (widtWind <= 1200) {
var count = 3;
} else {
var count = 4;
}
$pack.on('click',function(e) {
var href = $(this).find('a').attr('href') ;
if ( href == '#') {
e.preventDefault();
}
var idThis = $(this).parent('.pack').attr('id');
var $more = $('.__more#' + idThis);
2019-06-16 17:47:42 +02:00
2021-06-11 16:24:49 +02:00
$('.__more').removeClass('visible');
$('.triangle').removeClass('visible');
var i = count;
$more.addClass('visible');
$(this).find('.triangle').addClass('visible')
})
var $close = $('.__more .close');
$close.on('click' , function(e) {
console.log('clsick');
$(this).parents('.__more').removeClass('visible');
$('.triangle').removeClass('visible');
})
}
2019-06-16 17:47:42 +02:00
2019-04-10 16:38:49 +02:00
jQuery(document).ready(function(){
2019-06-16 17:47:42 +02:00
tarteaucitron.init({
"privacyUrl": "/charte-cookies", /* Privacy policy url */
2019-06-16 18:11:58 +02:00
"hashtag": "#gestion_des_cookies", /* Open the panel with this hashtag */
2019-06-16 18:25:50 +02:00
"cookieName": "gestion_des_cookies", /* Cookie name */
2019-06-16 17:47:42 +02:00
"orientation": "bottom", /* Banner position (top - bottom) */
"showAlertSmall": false, /* Show the small banner on bottom right */
"cookieslist": false, /* Show the cookie list */
"adblocker": false, /* Show a Warning if an adblocker is detected */
"AcceptAllCta" : true, /* Show the accept all button when highPrivacy on */
2019-07-05 16:31:58 +02:00
"highPrivacy": true, /* Disable auto consent */
2019-06-16 17:47:42 +02:00
"handleBrowserDNTRequest": true, /* If Do Not Track == 1, disallow all */
"removeCredit": false, /* Remove credit link */
"moreInfoLink": true, /* Show more info link */
"useExternalCss": true, /* If false, the tarteaucitron.css file will be loaded */
//"cookieDomain": ".my-multisite-domaine.fr", /* Shared cookie for multisite */
"readmoreLink": "/cookiespolicy" /* Change the default readmore link */
});
2019-05-09 00:26:27 +02:00
addclass();
2019-06-05 12:54:15 +02:00
mapsalles();
2019-05-09 00:26:27 +02:00
clickbutton();
2019-06-07 19:04:55 +02:00
clicksenddevis();
2019-04-08 18:00:38 +02:00
links();
2019-04-05 00:19:26 +02:00
slide();
2019-04-08 18:00:38 +02:00
filteritem();
2019-04-10 16:38:49 +02:00
map();
2019-05-31 23:37:11 +02:00
burger();
2021-06-11 16:24:49 +02:00
2021-06-12 14:36:11 +02:00
2021-06-11 16:24:49 +02:00
if ($('section').is("#nos-packs")) {
open_pack();
}
2019-04-02 19:54:29 +02:00
});