Commit d7ec2473 authored by Nathan Peraldi's avatar Nathan Peraldi

remove: useless JS

parent a035dafc
......@@ -37,51 +37,5 @@ $the_event = $EM_Event->output_single();
//on enlève ce texte inutile de cette manière car aucun moyen de faire autrement !
$the_event = str_replace("Carte non disponible", "", $the_event);
//si "button" détecté, alors on s'occupe du formulaire d'inscription
if (strpos($the_event, "BUTTON") !== false) {
recup_nombre();
//on se prépare à comparer la date actuelle avec la date de l'évènement pour ouvrir / fermer les inscriptions.
$timestamp_event = strtotime($EM_Event->start_date);
$timestamp_actual = time();
if ($timestamp_event > $timestamp_actual) {
$the_event = str_replace("BUTTON", "<button id='adullact-display-mask'>" . $sinscrire . "</button>", $the_event);
echo $the_event;
?>
<script>
//on effectue les opérations pour afficher / cacher le formulaire d'inscription à l'évènement
function display_mask() {
if (the_form.style.display === "block") {
the_form.style.display = "none";
document.getElementById("adullact-display-mask").style.color = "dimgrey";
document.getElementById("adullact-display-mask").style.backgroundColor = "white"
} else {
the_form.style.display = "block";
document.getElementById("adullact-display-mask").style.color = "white";
document.getElementById("adullact-display-mask").style.backgroundColor = "#3f7ca2"
}
}
var results = document.getElementsByClassName("wpcf7");
var the_form = results[0];
the_form.style.display = "none";
var the_button = document.getElementById("adullact-display-mask");
the_button.addEventListener("click", display_mask);
</script>
<?php
} else {
$the_event = str_replace("BUTTON", "<button id='adullact-display-mask'>" . $inscriptions_closes . "</button>", $the_event);
echo $the_event;
?>
<script>
var results = document.getElementsByClassName("wpcf7");
var the_form = results[0];
var the_parent = document.getElementsByClassName("entry-content")[0];
the_parent.removeChild(the_form);
</script>
<?php
}
} else {
//puisqu'il n'y a pas de formulaire d'inscription, on affiche simplement l'évènement.
echo $the_event;
}
\ No newline at end of file
//on affiche simplement l'évènement.
echo $the_event;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment