135 lines
3.0 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-04-10 16:38:49 +02:00
L.marker([44.7365818, 4.9776488], {icon: greenIcon}).addTo(mymap)
.bindPopup("<b>Hello world!</b><br />I am le campus.").openPopup();
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,
auto:true,
2019-04-05 00:19:26 +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() {
var $button = $('#ajax-test-form .radio');
$button.on('click', function(){
$(this).parent('.form-data').find('.check').removeClass('check');
$(this).addClass('check');
});
}
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-05-09 00:26:27 +02:00
}
2019-04-10 16:38:49 +02:00
jQuery(document).ready(function(){
2019-05-09 00:26:27 +02:00
addclass();
clickbutton();
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-27 17:03:03 +02:00
2019-04-02 19:54:29 +02:00
});