diff --git a/index.php b/index.php
index b94b91f..66562a6 100644
--- a/index.php
+++ b/index.php
@@ -170,8 +170,8 @@ function definition_courante($definitions, $position) {
?>
"
- data-iddv="= isset($definition_verticale["definition"])? "dv-$x.$iddv" : "" ?>"
+ data-iddh="= isset($definition_horizontale["definition"])? "dh-$y-$iddh" : "" ?>"
+ data-iddv="= isset($definition_verticale["definition"])? "dv-$x-$iddv" : "" ?>"
/>
@@ -188,25 +188,23 @@ function definition_courante($definitions, $position) {
return isset($definition["definition"]);
});
?>
-
$definition): ?>
-
+ ">
+
$definition): ?>
-
+ - ">
+
+
+
-
@@ -218,25 +216,23 @@ function definition_courante($definitions, $position) {
return isset($definition["definition"]);
});
?>
-
$definition): ?>
-
+ ">
+
$definition): ?>
-
+ - ">
+
+
+
-
@@ -251,11 +247,9 @@ function definition_courante($definitions, $position) {
de
-
- value="= $hauteur ?>" min="= HAUTEUR_MIN ?>" max="= HAUTEUR_MAX ?>" />
+ value="= $hauteur ?>" min="= HAUTEUR_MIN ?>" max="= HAUTEUR_MAX ?>" />
lignes et
-
- value="= $largeur ?>" min="= LARGEUR_MIN ?>" max="= LARGEUR_MAX ?>" />
+ value="= $largeur ?>" min="= LARGEUR_MIN ?>" max="= LARGEUR_MAX ?>" />
colonnes
diff --git a/script.js b/script.js
index ce1ff9c..c660983 100644
--- a/script.js
+++ b/script.js
@@ -17,19 +17,37 @@ for (let input of inputs) {
input.onfocus = function (event) {
for (li of document.querySelectorAll(
- `.definitions.horizontales > ol > li:nth-child(${
- input.y + 1
- }), .definitions.verticales > ol > li:nth-child(${input.x + 1})`
+ `.definitions.horizontales > ol > li:nth-child(${input.y + 1}), .definitions.verticales > ol > li:nth-child(${input.x + 1})`
)) {
li.classList.add("selectionee");
}
for (li of document.querySelectorAll(
- `.definitions.horizontales > ol > li:not(:nth-child(${
- input.y + 1
- })), .definitions.verticales > ol > li:not(:nth-child(${input.x + 1}))`
+ `.definitions.horizontales > ol > li:not(:nth-child(${input.y + 1})), .definitions.verticales > ol > li:not(:nth-child(${input.x + 1}))`
)) {
li.classList.add("non-selectionee");
}
+ if (input.dataset.iddh) {
+ for (li of document.querySelectorAll(`.definitions.horizontales ol li ol #${input.dataset.iddh}`)) {
+ for (liVoisin of li.parentElement.querySelectorAll("li")) {
+ if (liVoisin == li) {
+ liVoisin.classList.add("selectionee");
+ } else {
+ liVoisin.classList.add("non-selectionee");
+ }
+ }
+ }
+ }
+ if (input.dataset.iddv) {
+ for (li of document.querySelectorAll(`.definitions.verticales ol li ol #${input.dataset.iddv}`)) {
+ for (liVoisin of li.parentElement.querySelectorAll("li")) {
+ if (liVoisin == li) {
+ liVoisin.classList.add("selectionee");
+ } else {
+ liVoisin.classList.add("non-selectionee");
+ }
+ }
+ }
+ }
input.select();
};
@@ -79,21 +97,11 @@ for (let input of inputs) {
};
input.onblur = function (event) {
- for (li of document.querySelectorAll(
- `.definitions.horizontales > ol > li:nth-child(${
- input.y + 1
- }), .definitions.verticales > ol > li:nth-child(${input.x + 1})`
- )) {
+ for (li of document.querySelectorAll(".definitions li")) {
li.classList.remove("selectionee");
- }
- for (li of document.querySelectorAll(
- `.definitions.horizontales > ol > li:not(:nth-child(${
- input.y + 1
- })), .definitions.verticales > ol > li:not(:nth-child(${input.x + 1}))`
- )) {
li.classList.remove("non-selectionee");
}
- };
+ }
}
for (let input of grilleForm.querySelectorAll(".nouvelle-grille input")) {