|
115
|
1 |
$(function(){ |
|
133
|
2 |
//filters |
|
|
3 |
$('.filters a').each(function(){ |
|
|
4 |
var text = $.trim($(this).text()); |
|
|
5 |
if(text.length > 30){ |
|
|
6 |
$(this).text(text.substr(0, 30) + '...') |
|
|
7 |
} |
|
|
8 |
}); |
|
119
|
9 |
//masonry |
|
132
|
10 |
var masonry465 = $('.masonry-465'); |
|
|
11 |
masonry465.masonry({ |
|
118
|
12 |
columnWidth: 465, |
|
132
|
13 |
itemSelector: '.item-masonry', |
|
118
|
14 |
gutter : 20 |
|
|
15 |
}); |
|
132
|
16 |
|
|
|
17 |
var masonry225 = $('.masonry-225'); |
|
|
18 |
masonry225.masonry({ |
|
|
19 |
columnWidth: 225, |
|
|
20 |
itemSelector: '.item-masonry', |
|
|
21 |
gutter : 16 |
|
|
22 |
}); |
|
138
|
23 |
|
|
119
|
24 |
//popin |
|
131
|
25 |
$('.open-popin').bind('click', function(e){ |
|
118
|
26 |
e.preventDefault(); |
|
119
|
27 |
var target = $(this).attr('href'); |
|
|
28 |
$('.popin-wrap').fadeIn(function(){ |
|
|
29 |
$(target).show(); |
|
|
30 |
}); |
|
|
31 |
}); |
|
|
32 |
|
|
|
33 |
$('.close-popin, .popin-wrap').bind('click', function(e){ |
|
|
34 |
e.preventDefault(); |
|
|
35 |
e.stopPropagation(); |
|
|
36 |
$('.popin-wrap').fadeOut(function(){ |
|
|
37 |
$('.popin').hide(); |
|
|
38 |
}); |
|
|
39 |
}); |
|
|
40 |
|
|
|
41 |
$('.popin').bind('click', function(e){ |
|
|
42 |
e.stopPropagation(); |
|
118
|
43 |
}); |
|
128
|
44 |
//tag it |
|
132
|
45 |
if($('.tag-it').length){ |
|
|
46 |
var keywordsTagIt = $('.tag-it').tagit({ |
|
|
47 |
allowSpaces : true |
|
|
48 |
}); |
|
|
49 |
$('.list-key-add a').bind('click', function(e){ |
|
|
50 |
e.preventDefault(); |
|
|
51 |
var tag = $(this).attr('data-tag'); |
|
|
52 |
keywordsTagIt.tagit("createTag", tag); |
|
|
53 |
}); |
|
|
54 |
} |
|
155
|
55 |
//map |
|
|
56 |
if($('#map').length){ |
|
160
|
57 |
initmap() |
|
155
|
58 |
} |
|
160
|
59 |
function initmap() { |
|
|
60 |
// set up the map |
|
|
61 |
map = new L.Map('map'); |
|
|
62 |
|
|
|
63 |
// create the tile layer with correct attribution |
|
|
64 |
var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; |
|
|
65 |
var osm = new L.TileLayer(osmUrl, {minZoom: 3, maxZoom: 20}); |
|
|
66 |
|
|
|
67 |
// start the map in South-East England |
|
|
68 |
map.setView(new L.LatLng(48.833, 2.333),4); |
|
|
69 |
map.addLayer(osm); |
|
|
70 |
|
|
|
71 |
// markers |
|
|
72 |
var marker1 = L.marker([48.833, 2.333]).addTo(map); |
|
|
73 |
marker1.bindPopup("Beaux-Arts de Paris"); |
|
|
74 |
var marker2 = L.marker([47.233,-1.583]).addTo(map); |
|
|
75 |
marker2.bindPopup("Beaux-Arts de Nantes"); |
|
|
76 |
} |
|
|
77 |
|
|
115
|
78 |
});//ready |