mirror of
https://gitlab.aliens-lyon.fr/savrillo/gpens.git
synced 2026-03-18 01:51:04 +01:00
Modification de la norme SVG et des fichier les traitant. Manque de plus de tests.
This commit is contained in:
parent
95b3fea2ef
commit
8852e70c7e
@ -148,7 +148,7 @@
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<object type="image/svg+xml" data="maps/M-MGN1-3.svg" id="plan" onload="initSvgSupport()"></object>
|
||||
<object type="image/svg+xml" data="maps/M-MGN1-4.svg" id="plan"></object>
|
||||
|
||||
<div class="card">
|
||||
<h4 class="card-header">Salle actuelle</h4>
|
||||
|
||||
1564
maps/M-MGN1-4.svg
1564
maps/M-MGN1-4.svg
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 788 KiB After Width: | Height: | Size: 56 KiB |
@ -46,16 +46,16 @@ function selectRoom(roomId) {
|
||||
selectedRooms[i].classList.remove('current-room');
|
||||
}
|
||||
|
||||
var room = svg.contentDocument.getElementById('path-salle-' + roomId);
|
||||
var room = svg.contentDocument.getElementById('salle-' + roomId);
|
||||
|
||||
if (room == null) {
|
||||
console.log('Error: the room does not exist');
|
||||
console.log('Error: the room salle-'+roomId+' does not exist');
|
||||
return;
|
||||
}
|
||||
|
||||
room.classList.add('current-room');
|
||||
|
||||
httpGetAsync("api/request.php?salle="+room.id.substring("path-salle-".length), function (s,errcode){
|
||||
httpGetAsync("api/request.php?salle="+room.id.substring("salle-".length), function (s,errcode){
|
||||
window.clearTimeout(document.wnsTimeout);
|
||||
|
||||
if (s == "404") {
|
||||
@ -66,7 +66,7 @@ function selectRoom(roomId) {
|
||||
}
|
||||
|
||||
salle = JSON.parse(s)
|
||||
if (room.id == "path-salle-" + salle["id"]) {
|
||||
if (room.id == "salle-" + salle["id"]) {
|
||||
if (errcode == 200) {
|
||||
titres = ((salle.aliaz.length!=0)?(salle.aliaz.join(' ou ')):"Aucun alias connu.");
|
||||
document.getElementById('room-name').innerText = titres;
|
||||
@ -106,11 +106,11 @@ function initSvgSupport()
|
||||
|
||||
svgPanZoom(plan, {zoomEnabled: true, controlIconsEnabled: true});
|
||||
|
||||
var salles = plan.contentDocument.getElementsByClassName('svg-salle');
|
||||
var salles = plan.contentDocument.querySelectorAll('#salles-group path');
|
||||
|
||||
for (var i = 0; i < salles.length; i++) {
|
||||
salles[i].addEventListener('click', function(e) {
|
||||
var id = e.target.id.substring('path-salle-'.length); // Remove prefix
|
||||
var id = e.target.id.substring('salle-'.length); // Remove prefix
|
||||
selectRoom(id);
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
.svg-salle {
|
||||
#salles-group path {
|
||||
transition: fill .3s;
|
||||
|
||||
fill: #bbb;
|
||||
fill: #9d9;
|
||||
stroke: none;
|
||||
stroke-width: 1px;
|
||||
stroke-linecap: butt;
|
||||
@ -9,10 +9,32 @@
|
||||
stroke-opacity: 1;
|
||||
}
|
||||
|
||||
.svg-salle:hover {
|
||||
#salles-group path:hover {
|
||||
fill: #fe5400aa;
|
||||
}
|
||||
|
||||
.current-room {
|
||||
#wall-group path {
|
||||
fill:#611010;
|
||||
fill-opacity:1;
|
||||
stroke:none;
|
||||
stroke-width:1px;
|
||||
stroke-linecap:butt;
|
||||
stroke-linejoin:miter;
|
||||
stroke-opacity:1
|
||||
}
|
||||
|
||||
#glass-group path {
|
||||
fill:#c0c0c0;
|
||||
fill-opacity:1;
|
||||
stroke:#5b5b5b;
|
||||
stroke-width:1.60000002;
|
||||
stroke-linecap:round;
|
||||
stroke-linejoin:bevel;
|
||||
stroke-miterlimit:4;
|
||||
stroke-dasharray:none;
|
||||
stroke-opacity:1
|
||||
}
|
||||
|
||||
#salles-group path.current-room {
|
||||
fill: #fe5400;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user