209 lines
4.8 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) {
e.preventDefault();
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',
gutter: 10,
transitionDuration: '0.2s'
});
2019-04-10 16:38:49 +02:00
// $( "a[hreflang|='en']" ).css( "border", "3px dotted green" );
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
$('.gal-salles').bxSlider({
2019-06-05 12:19:48 +02:00
pagerType: 'full',
2019-06-02 18:07:05 +02:00
responsive: true,
2019-06-05 12:19:48 +02:00
mode: 'fade',
captions: true,
});
2019-06-02 18:07:05 +02:00
2019-04-08 18:00:38 +02:00
}
function links() {
2019-04-09 18:05:36 +02:00
var $a = $('li a[href="/organisez-vos-evenements"],li a[href="/qui-sommes-nous"] ');
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-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
2019-04-10 16:38:49 +02:00
jQuery(document).ready(function(){
2019-06-07 19:04:55 +02:00
// ajaxformulaire();
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();
2019-04-02 19:54:29 +02:00
});