diff --git a/view/input.php b/view/input.php index 937d86e..659235a 100755 --- a/view/input.php +++ b/view/input.php @@ -52,10 +52,9 @@

Ajouter un contact

-

hi

-

FULL CSS BIATCH !!

-

Saisir les informations sur les contacts

+ +

Remplir les fiches relations des contacts

diff --git a/view/js/input-min.js b/view/js/input-min.js index 9378a4b..851eb7d 100644 --- a/view/js/input-min.js +++ b/view/js/input-min.js @@ -1 +1,3 @@ -var ic=new inputChecker,fileInput=document.querySelector('input#call_log-import[type="file"]');fileInput.addEventListener("change",function(a){api.send({path:"upload/call_log",file:fileInput.files[0]},function(a){console.log(a)})},!1);var number=document.querySelector('input.number[type="text"]');ic.append(number,format_number,"06 06 06 06 06");number.addEventListener("keyup",function(a){ic.correct(number,!1)},!1); +var newContact="

",newContact=newContact+"",newContact=newContact+"",newContact=newContact+"",newContact=newContact+"",newContact=newContact+"", +newContact=newContact+"

",ficheRelation="",ic=new inputChecker,importCallLog=document.querySelector('input#call_log-import[type="file"]');function contactForms(){return document.querySelectorAll("h4.new-contact")}var addContact=document.querySelector("h4.add-contact");function relationForms(){return document.querySelectorAll()}importCallLog.addEventListener("change",function(a){api.send({path:"upload/call_log",file:importCallLog.files[0]},function(a){console.log(a)})},!1);var number=document.querySelector('input.number[type="text"]'); +ic.append(number,format_number,"06 06 06 06 06");number.addEventListener("keyup",function(a){ic.correct(number,!1)},!1); diff --git a/view/js/input.js b/view/js/input.js index 683ef21..895bdb5 100644 --- a/view/js/input.js +++ b/view/js/input.js @@ -1,20 +1,53 @@ -// Vérifiera les input +/* [0] Gestion des constantes et HTML +=========================================================*/ +/* (1) Contiendra le formulaire d'ajout de contact (numéro, pseudo, prénom, nom, submit) */ +var newContact = "

"; + newContact += ""; + newContact += ""; + newContact += ""; + newContact += ""; + newContact += ""; + newContact += "

"; + +/* (2) TODO: Contiendra la fiche relation complète */ +var ficheRelation = ""; + + +/* [1] Initialisation de l'inputChecker +=========================================================*/ +// Instanciation var ic = new inputChecker(); -var fileInput = document.querySelector('input#call_log-import[type="file"]'); + +/* [2] Indexation des inputs +=========================================================*/ +/* (1) Input de type fichier pour l'import */ +var importCallLog = document.querySelector('input#call_log-import[type="file"]'); + +/* (2) Contiendra les formulaires des contacts ajoutés */ +function contactForms(){ return document.querySelectorAll('h4.new-contact'); } + +/* (3) Bouton d'ajout de contact */ +var addContact = document.querySelector('h4.add-contact'); + +/* (4) Contiendra les formulaires de fiche relation */ +function relationForms(){ return document.querySelectorAll(); } -fileInput.addEventListener('change', function(e){ +/* [3] Gestion de l'import du fichier +=========================================================*/ +importCallLog.addEventListener('change', function(e){ /* (1) On rédige la requête */ var uploadRequest = { path: 'upload/call_log', - file: fileInput.files[0] + file: importCallLog.files[0] }; /* (2) On effectue l'upload (import) */ api.send(uploadRequest, function(response){ console.log( response ); + // TODO: Gestion de l'ajout des fiches relation }); }, false);