|
115
|
1 |
$(function(){ |
|
188
|
2 |
|
|
119
|
3 |
//masonry |
|
132
|
4 |
var masonry465 = $('.masonry-465'); |
|
|
5 |
masonry465.masonry({ |
|
118
|
6 |
columnWidth: 465, |
|
132
|
7 |
itemSelector: '.item-masonry', |
|
118
|
8 |
gutter : 20 |
|
|
9 |
}); |
|
132
|
10 |
|
|
|
11 |
var masonry225 = $('.masonry-225'); |
|
|
12 |
masonry225.masonry({ |
|
|
13 |
columnWidth: 225, |
|
|
14 |
itemSelector: '.item-masonry', |
|
|
15 |
gutter : 16 |
|
|
16 |
}); |
|
138
|
17 |
|
|
119
|
18 |
//popin |
|
131
|
19 |
$('.open-popin').bind('click', function(e){ |
|
118
|
20 |
e.preventDefault(); |
|
119
|
21 |
var target = $(this).attr('href'); |
|
|
22 |
$('.popin-wrap').fadeIn(function(){ |
|
|
23 |
$(target).show(); |
|
|
24 |
}); |
|
|
25 |
}); |
|
|
26 |
|
|
|
27 |
$('.close-popin, .popin-wrap').bind('click', function(e){ |
|
|
28 |
e.preventDefault(); |
|
|
29 |
e.stopPropagation(); |
|
|
30 |
$('.popin-wrap').fadeOut(function(){ |
|
|
31 |
$('.popin').hide(); |
|
|
32 |
}); |
|
|
33 |
}); |
|
|
34 |
|
|
|
35 |
$('.popin').bind('click', function(e){ |
|
|
36 |
e.stopPropagation(); |
|
118
|
37 |
}); |
|
128
|
38 |
//tag it |
|
132
|
39 |
if($('.tag-it').length){ |
|
|
40 |
var keywordsTagIt = $('.tag-it').tagit({ |
|
|
41 |
allowSpaces : true |
|
|
42 |
}); |
|
|
43 |
$('.list-key-add a').bind('click', function(e){ |
|
|
44 |
e.preventDefault(); |
|
|
45 |
var tag = $(this).attr('data-tag'); |
|
|
46 |
keywordsTagIt.tagit("createTag", tag); |
|
|
47 |
}); |
|
|
48 |
} |
|
185
|
49 |
|
|
188
|
50 |
|
|
185
|
51 |
|
|
|
52 |
// add item to collection behaviour |
|
|
53 |
$('.additemtocollection').bind('click', function(e){ |
|
|
54 |
// When an item meant to be added to a collection is clicked, |
|
|
55 |
// we fill the form in the add-to-collection div |
|
|
56 |
$('#add-to-collection .item-type').val($(this).attr('data-type')); |
|
|
57 |
$('#add-to-collection .item-id').val($(this).attr('data-id')); |
|
|
58 |
}); |
|
|
59 |
|
|
|
60 |
|
|
219
|
61 |
$(".ajax-form").submit(function(e) { // On submit Ajax Form |
|
|
62 |
var formel = $(this); |
|
|
63 |
$.ajax({ |
|
|
64 |
url: formel.attr("action"), |
|
|
65 |
type: formel.attr("method"), |
|
|
66 |
data: formel.serialize(), |
|
|
67 |
success: function(text) { |
|
|
68 |
$('.popin-wrap').fadeIn(function(){ |
|
|
69 |
$(".additem-success").show(); |
|
|
70 |
}); |
|
|
71 |
//console.log("received : " + text); |
|
|
72 |
$(".additem-success .collection-url").attr("href", text); |
|
|
73 |
}, |
|
|
74 |
error: function() { |
|
|
75 |
$('.popin-wrap').fadeIn(function(){ |
|
|
76 |
$(".additem-error").show(); |
|
|
77 |
}); |
|
|
78 |
} |
|
|
79 |
}); |
|
|
80 |
formel.parents(".popin").hide(); |
|
|
81 |
return false; |
|
|
82 |
}); |
|
188
|
83 |
|
|
155
|
84 |
if($('#map').length){ |
|
160
|
85 |
initmap() |
|
155
|
86 |
} |
|
188
|
87 |
function initmap() { |
|
|
88 |
// set up the map |
|
|
89 |
map = new L.Map('map'); |
|
160
|
90 |
|
|
188
|
91 |
// create the tile layer with correct attribution |
|
|
92 |
var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; |
|
|
93 |
var osm = new L.TileLayer(osmUrl, {minZoom: 3, maxZoom: 20}); |
|
160
|
94 |
|
|
188
|
95 |
// start the map in South-East England |
|
|
96 |
map.setView(new L.LatLng(48.833, 2.333),4); |
|
|
97 |
map.addLayer(osm); |
|
160
|
98 |
|
|
188
|
99 |
// markers |
|
|
100 |
var marker1 = L.marker([48.833, 2.333]).addTo(map); |
|
|
101 |
marker1.bindPopup("Beaux-Arts de Paris"); |
|
|
102 |
var marker2 = L.marker([47.233,-1.583]).addTo(map); |
|
|
103 |
marker2.bindPopup("Beaux-Arts de Nantes"); |
|
|
104 |
} |
|
160
|
105 |
|
|
185
|
106 |
});//ready |