1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
$(function(){
$('#default-message').dialog({'autoOpen':false,
'resizable':false,
width:630,
'dialogClass':'no-titlebar'});
var update_editmarker = function(){
$('#action-edit-event').removeClass('ui-state-active');
$('#action-edit-route').removeClass('ui-state-active');
$('#action-edit-marker').addClass('ui-state-active');
$('#frm-edit-route').hide();
$('#frm-edit-event').hide();
$('#frm-edit-marker').show();
$.ajax({url: edit_url,
dataType: "html",
success: function (data) {
$('#frm-edit-event').html('');
$('#frm-edit-route').html('');
$('#frm-edit-marker').html(data);
$("#main-map").chimere('activateMarkerEdit');
},
error: function (data) {
$('#frm-edit-marker').html("<p class='warning'>"+
default_error_message+"</p>");
}
});
};
var update_editevent = function(){
$('#action-edit-marker').removeClass('ui-state-active');
$('#action-edit-route').removeClass('ui-state-active');
$('#action-edit-event').addClass('ui-state-active');
$('#frm-edit-marker').hide();
$('#frm-edit-route').hide();
$('#frm-edit-event').show();
$.ajax({url: edit_event_url,
dataType: "html",
success: function (data) {
$('#frm-edit-marker').html('');
$('#frm-edit-route').html('');
$('#frm-edit-event').html(data);
$("#main-map").chimere('activateMarkerEdit');
},
error: function (data) {
$('#frm-edit-event').html("<p class='warning'>"+
default_error_message+"</p>");
}
});
};
var update_editroute = function(){
$('#action-edit-marker').removeClass('ui-state-active');
$('#action-edit-event').removeClass('ui-state-active');
$('#action-edit-route').addClass('ui-state-active');
$('#frm-edit-marker').hide();
$('#frm-edit-event').hide();
$('#frm-edit-route').show();
$.ajax({url: edit_route_url,
dataType: "html",
success: function (data) {
$('#frm-edit-marker').html('');
$('#frm-edit-event').html('');
$('#frm-edit-route').html(data);
$("#main-map").chimere('activateRouteEdit');
},
error: function (data) {
$('#frm-edit-route').html("<p class='warning'>"+
default_error_message+"</p>");
}
});
};
$("#action-news").click(function(){
$('#news').dialog('open');
});
$("#action-carte").click(function(){
$("#main-map").chimere('activateContextMenu');
if($("#itinerary_field").html()){
$("#chimere_itinerary_form").appendTo("#chimere_itinerary_panel");
if($("#chimere_itinerary").css('display') != 'none'){
$("#chimere_itinerary_form").hide();
}
}
$('#action-participate').removeClass('ui-state-active');
$('#action-carte').addClass('ui-state-active');
$('#edit-actions').hide();
$('#map-actions').show();
$('#edit-panel').hide();
$('#map-panel').show();
});
$("#action-participate").click(function(){
$('#action-carte').removeClass('ui-state-active');
$('#action-participate').addClass('ui-state-active');
$('#map-actions').hide();
$('#edit-actions').show();
$('#map-panel').hide();
$('#edit-panel').show();
update_editmarker();
});
$("#action-edit-event").click(update_editevent);
$("#action-edit-marker").click(update_editmarker);
$("#action-edit-route").click(update_editroute);
$('.dyn-page').click(function(){
url = $(this).filter('a').attr('href');
$.ajax({url: url,
dataType: "html",
success: function (content) {
html = "<div class='dialog-content'>" +
content + "</div>"
$('#default-message').html(html);
$('#default-message').dialog('open');
}
});
return false;
});
$('.share-icon').click(function(){
$(this).hide();
$(this).parent().nextAll('.shared').show();
return false;
});
$('.print-page').click(function(){
window.print();
return false;
});
});
function display_feature_detail(data, settings){
settings.current_popup.setContentHTML("<div class='cloud'>" + data + "</div>");
$('.detail_zoomin').bind("click", function(){
$('#main-map').chimere('hidePopup');
$('#main-map').chimere('zoomIn');
});
$('.detail_zoomout').bind("click", function(){
$('#main-map').chimere('hidePopup');
$('#main-map').chimere('zoomOut');
});
$('.detail_from').bind("click", function(){
$('#main-map').chimere('hidePopup');
$('#main-map').chimere('routingFrom');
});
$('.detail_step').bind("click", function(){
$('#main-map').chimere('hidePopup');
$('#main-map').chimere('routingAddStep');
});
$('.detail_to').bind("click", function(){
$('#main-map').chimere('hidePopup');
$('#main-map').chimere('routingTo');
});
jQuery(".close_img").click(function(){
$("#main-map").chimere('hidePopup');
});
jQuery("#read_more_"+settings.current_feature.pk).click(function(){
$("#description_short_"+settings.current_feature.pk).hide();
$("#description_long_"+settings.current_feature.pk).show();
$("#read_more_"+settings.current_feature.pk).hide();
$("#read_less_"+settings.current_feature.pk).show();
});
jQuery("#read_less_"+settings.current_feature.pk).click(function(){
$("#description_long_"+settings.current_feature.pk).hide();
$("#description_short_"+settings.current_feature.pk).show();
$("#read_less_"+settings.current_feature.pk).hide();
$("#read_more_"+settings.current_feature.pk).show();
});
$('.share-icon').click(function(){
$(this).hide();
$(this).parent().nextAll('.shared').show();
return false;
});
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto({
show_title: false,
social_tools: ''
});
});
$('html').addClass('js-on');
$(function(){
$('div.media-player').jmeEmbedControls();
});
}
|