-
Notifications
You must be signed in to change notification settings - Fork 14
/
cantons_sans_admin_centre.html
243 lines (239 loc) · 5.03 KB
/
cantons_sans_admin_centre.html
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<html>
<head>
<meta charset="UTF-8">
<title>Cantons sans chef-lieu</title>
<script src="js/jquery-2.1.1.min.js"></script>
<script src="js/jquery.tablesorter.min.js"></script>
<style>
body{
font-family: monospace;
}
#bandeau{
top:0px;
width:100%;
height:150px;
z-index:3;
position:fixed;
background-color:white;
}
.cellule_intitule{
text-align: right;
}
.cellule_data{
font-weight: bold;
}
#rubriques{
position:absolute;
top:130px;
}
#rubriques th{
background-color:black;
color:white;
}
#reponse{
position:absolute;
top:150px;
z-index:2;
}
.emphase{
color:red;
font-size: x-large;
}
.rubrique{
cursor:pointer;
width:200px;
height:50px;
position:relative;
color:black;
font-weight: bold;
background:white;
margin-right:10px;
}
.rubrique.active{
border:3px solid black;
}
.table_liste{
display:none;
}
.zone_click{
cursor:pointer;
color:blue;
text-decoration: underline;
}
.zone_click.clicked{
background-color:green;
color:white;
}
#refresh_infos{
position: fixed;
width: 250px;
height: 56px;
top: 6px;
right: 109px;
display:none;
}
#refresh_infos span{
font-weight: bold;
}
#bouton_refresh{
position: fixed;
background-image: url("img/72176-600.png");
background-size: 49px 56px;
background-repeat: no-repeat;
width: 49px;
height: 56px;
top: 6px;
right: 60px;
}
#infos_refresh{
width:100%;
height:200px;
top:0px;
left:0px;
background-color:lightgrey;
opacity:0.8;
position:fixed;
//visibility:hidden;
display:none;
z-index: 15;
}
#wait_ajax{
position:fixed;
z-index:1;
width:100%;
height:100%;
background-color:lightgray;
opacity:0;
text-align:center;
}
#wait_ajax span{
background-color:black;
vertical-align:middle;
font-size:30px;
line-height:500px;
color:white;
border:50px solid black;
}
#infobulle_aide{
position: fixed;
color: red;
background: #dddddd;
width: 40px;
height: 40px;
border-radius: 40px;
top: 10px;
right: 10px;
vertical-align: bottom;
text-align: center;
font-weight: bolder;
font-size: 35px;
}
#aide{
position:fixed;
top:5px;
right:5px;
width:400px;
height:100%;
background-color:lavender;
overflow-y:scroll;
visibility:hidden;
z-index: 10;
}
#table_canton tr td,
background:white;
color:black;
font-weight: normal;
}
#pied_de_page{
position:relative;
width:100%;
height:30px;
z-index:3;
}
#credits{
background:darkgrey;
position:fixed;
bottom:0px;
width:100%;
overflow:visible;
z-index:4;
text-align: justify;
}
</style>
<script>
var menu_labels
var commune_valide = false
var osm_state
function start(){
$('body').css('cursor','progress');
$('#wait_ajax').empty()
.css('z-index','20')
.css('opacity','0.8')
.append($('<span>').append('Recherche des cantons sans admin_centre...'));
$.ajax({
url: "cantons_sans_AC.py",
})
.done(function( data ){
titre_bandeau = ' Cantons sans admin_centre'
if (data.length == 1){
titre_bandeau = ' Canton sans admin_centre'
}
$('#bandeau h1').append(data.length+titre_bandeau)
$('#wait_ajax').append($('<span>').append("Ok"));
$('body').css('cursor','default');
$('#wait_ajax').css('z-index','1').css('opacity','0');
add_header('table_canton',true)
table = 'table_canton'
for (l=0;l<data.length;l++){
//Dept
$('#'+table).append($('<tr>').attr('id',data[l][0]).append($('<td>').text(data[l][0])))
//Nom du canton
$('#'+table+' tr:last').append($('<td>').text(data[l][1]))
//Nom du CL
$('#'+table+' tr:last').append($('<td>').text(data[l][2]))
//JOSM
add_josm_link(table,data[l][3],data[l][4])
}
}
)
};
function add_josm_link(table,rel_id,node_id){
$('#'+table+' tr:last').append($('<td>')
.addClass('zone_click')
.text('JOSM')
.click(function(){
$('<img>').appendTo($('#josm_target')).attr('src','http://127.0.0.1:8111/load_object?new_layer=true&relation_members=true&objects=r'+rel_id+',n'+node_id);
$(this).addClass('clicked');
})
)
}
function add_header(table,with_edit_and_map_links){
$('#'+table).append($('<tr>').append($('<th>').append('Département')))
$('#'+table+' tr').append($('<th>').append('Canton'))
$('#'+table+' tr').append($('<th>').append('Admin_centre à ajouter'))
$('#'+table+' tr').append($('<th>').append('Lien JOSM'))
}
</script>
</head>
<body onload="start()">
<div id="bandeau">
<h1></h1>
<h4>Liste des relations de Cantons sans noeud avec un rôle admin_centre</h4>
<div id="pied_de_page"></div>
</div>
<!-- <table id="rubriques">
<tr><td class="rubrique" id="rub_adresses_non_match" cible="table_canton"></td>
</tr>
</table>
--></div>
<div id="reponse">
<table id="table_canton" class="table_liste_"></table>
<div id="pied_de_page"></div>
</div>
<div id="credits">
Données OpenStreetMap : © les Contributeurs d'OpenStreetMap <a href="http://opendatacommons.org/licenses/odbl/">Licence ODbL</a>
</div>
<div id="josm_target" style="visibility : hidden"></div>
<div id="wait_ajax"></div>
</body>
</html>