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() {
|
|
|
|
var $card = $('#item > .card');
|
|
|
|
var $cat = $('.cat a');
|
|
|
|
var $img = $('#item .img');
|
|
|
|
|
2019-04-10 16:38:49 +02:00
|
|
|
$(".filters .btn").click(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
var filter = $(this).attr("data-filter");
|
|
|
|
var self = $('.container #item');
|
|
|
|
|
|
|
|
self.masonryFilter({
|
|
|
|
filter: function () {
|
|
|
|
if (!filter) return true;
|
|
|
|
return $(this).attr("data-filter") == filter;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2019-04-08 18:00:38 +02:00
|
|
|
var $grid = $('#archive #item, #calendrier #item').masonry({
|
|
|
|
// 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() {
|
|
|
|
$(".gal").slidesjs({
|
|
|
|
width: 940,
|
|
|
|
height: 528,
|
|
|
|
pagination: {
|
|
|
|
active: false
|
|
|
|
}
|
|
|
|
});
|
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-04-10 16:38:49 +02:00
|
|
|
jQuery(document).ready(function(){
|
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-04-02 19:54:29 +02:00
|
|
|
});
|