From 0ee7840789d9087114befccc3238b9829bb05990 Mon Sep 17 00:00:00 2001 From: nicrausaz <n.crausaz99@gmail.com> Date: Fri, 12 Oct 2018 11:15:13 +0200 Subject: [PATCH] clear script, comments --- canapEPFL/form.php | 23 ++++++++++++++++------- canapEPFL/script.js | 20 -------------------- canapEPFL/templates/head.php | 2 +- 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/canapEPFL/form.php b/canapEPFL/form.php index be3a0b4..f503e70 100644 --- a/canapEPFL/form.php +++ b/canapEPFL/form.php @@ -68,7 +68,7 @@ </select> </div> <!-- / Choix formation --> - <div id="all" style="display: none;"> <!-- hide it --> + <div id="all" style="display: none;"> <div class="form-group"> <!-- Infos filières informaticien --> <div id="infoOnly"> @@ -215,6 +215,7 @@ <hr> <!-- Activités pro --> <h3>3. Activités</h3> + <!-- Scolarité --> <h5>3.1 Scolarité</h5> <table id="scolaire"> <tr> @@ -260,6 +261,8 @@ <input type="text" name="anneeFin" id="anneeFin" class="form-control" placeholder="Année de fin de scolarité" value="<?php echo $_SESSION['postedForm']['anneeFin'] != '' ? $_SESSION['postedForm']['anneeFin'] : ''; ?>" maxlength="4" data-required/> <small id="anneeFinError" class="error form-text text-muted"></small> </div> + <!-- / Scolarité --> + <!-- Formations --> <h5>3.2 Activités professionnelles</h5> <small>Formations / apprentissages après la scolarité.</small> @@ -295,6 +298,8 @@ <?php }} ?> </table> <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addPro">Ajouter une ligne</button> + <!-- / Formations --> + <!-- Stages --> <h5 class="mt-3">3.3 Stages</h5> <table id="stages"> <tr> @@ -339,13 +344,15 @@ <input type="text" name="dejaCandAnnee" id="dejaCandAnneeInput" class="form-control" placeholder="Année de candidature" value="<?php echo $_SESSION['postedForm']['dejaCandAnnee'] != '' ? $_SESSION['postedForm']['dejaCandAnnee'] : ''; ?>" maxlength="4"/> <small id="dejaCandError" class="form-text text-muted error"></small> </div> + <!-- / Stages --> <!-- / Activités pro --> <hr> + <!-- Annexes --> <h3>4. Annexes</h3> <small>Merci de joindre tous les fichiers demandés, en respectant les formats (si les formats ne sont pas respectés, les fichiers ne seront pas pris en compte).</small> <br> <small>Formats autorisés: <b>PDF, JPG, JPEG, PNG</b></small> - + <!-- Annexes obligatoires --> <div class="form-group mt-3" id="files"> <div class="form-group"> <label for="photo">Photo passeport <strong>couleur: *</strong></label> @@ -390,7 +397,8 @@ <br> <small class="error" class="form-text text-muted"></small> </div> - + <!-- / Annexes obligatoires --> + <!-- Annexes spécifiques --> <div class="form-group" id="polyOnly"> <label for="gimch">Attestation de tests d'aptitudes GIM-CH (polymécanicien):</label> <input type="file" name="gimch" class="upload-input" id="gimch" onchange="changeTitleFile(this)"/> @@ -412,8 +420,8 @@ <br> <small class="error" class="form-text text-muted"></small> </div> - - + <!-- / Annexes spécifiques --> + <!-- Annexes supplémentaires --> <div class="form-group"> <table id="newCertifZone"> <tr> @@ -431,8 +439,9 @@ </table> </div> <button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addInputFile">Ajouter une annexe</button> - + <!-- / Annexes supplémentaires --> </div> + <!-- / Annexes --> <div class="form-group"> <div class="custom-control custom-checkbox" id="condDiv"> <input type="checkbox" class="custom-control-input" value="conditionsAcc" id="conditions" data-required/> @@ -450,7 +459,7 @@ if ($_SESSION['formError']) { echo "<script>showOnFormReturn(lieu);</script>"; } - // require_once('templates/footer.php'); + // require_once('templates/footer.php'); (debug du $_POST) ?> </body> </html> \ No newline at end of file diff --git a/canapEPFL/script.js b/canapEPFL/script.js index 4d7f8f4..28a6419 100644 --- a/canapEPFL/script.js +++ b/canapEPFL/script.js @@ -7,7 +7,6 @@ $(document).ready(function () { initAddRadioButtonEvent(); initDateChecker(); initDatepicker(); - // clearFiles(); checkRequired(); } }); @@ -64,7 +63,6 @@ function checkFileFormat(obj) { if (allowedExtensions.indexOf(fileExtension) == -1) { // extension invalide errorZone.innerHTML = 'Format invalide' - clearFileInput(obj); } else { // extension valide errorZone.innerHTML = ''; @@ -236,24 +234,6 @@ function showPolyAndInfoDivs(selectedFormation) { selectedFormation == "polyMecanicien" ? $("#polyOnly").show(1000) : $("#polyOnly").hide(500); } } -function clearFileInput(fileInput) { - $(fileInput).wrap('<form>').closest('form').get(0).reset(); - $(fileInput).unwrap(); -} - -function clearFileLabel(fileInputLabel) { - $(fileInputLabel)[0].title = "Aucun fichier choisi"; -} - -function clearFiles() { - $("#files input").each(function (input) { - clearFileInput(this); - }); - - $("#files label").each(function (input) { - clearFileLabel(this); - }); -} function checkRequired() { $("form").submit(function (e) { diff --git a/canapEPFL/templates/head.php b/canapEPFL/templates/head.php index 7b52995..45dbb9d 100644 --- a/canapEPFL/templates/head.php +++ b/canapEPFL/templates/head.php @@ -12,7 +12,7 @@ <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script src="./script.js"></script> <style>.error { color: red!important; }</style> -<noscript>Veuillez Activer JavaScript pour utiliser le service de postulation</noscript> +<noscript>Veuillez Activer JavaScript pour utiliser le service de postulation !</noscript> <?php ini_set("display_errors", 0); error_reporting(0); -- GitLab