Début du rérérencement des élements (js) + première idée sur les fiches relations dynamiques.
This commit is contained in:
parent
46bfb58b9c
commit
5745910542
|
@ -52,10 +52,9 @@
|
||||||
<input type='submit' class='primary no-line sub-number' value='Valider'>
|
<input type='submit' class='primary no-line sub-number' value='Valider'>
|
||||||
</h4>
|
</h4>
|
||||||
<h4 data-icon='+' class='add-contact'>Ajouter un contact</h4>
|
<h4 data-icon='+' class='add-contact'>Ajouter un contact</h4>
|
||||||
<p>hi</p>
|
|
||||||
<p>FULL CSS BIATCH !!</p>
|
|
||||||
<!-- <span data-tag='ET'></span> -->
|
<!-- <span data-tag='ET'></span> -->
|
||||||
<h3 data-n='3'>Saisir les informations sur les contacts</h3>
|
<span data-space></span>
|
||||||
|
<h3 data-n='3'>Remplir les fiches relations des contacts</h3>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
|
@ -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="<h4 data-icon='p' class='new-contact'>",newContact=newContact+"<input type='text' class='no-line number' placeholder='Num\u00e9ro de t\u00e9l\u00e9phone'>",newContact=newContact+"<input type='text' class='no-line username' placeholder='Pseudo'>",newContact=newContact+"<input type='text' class='no-line firstname' placeholder='Pr\u00e9nom'>",newContact=newContact+"<input type='text' class='no-line lastname' placeholder='Nom'>",newContact=newContact+"<input type='submit' class='primary no-line sub-number' value='Valider'>",
|
||||||
|
newContact=newContact+"</h4>",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);
|
||||||
|
|
|
@ -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 = "<h4 data-icon='p' class='new-contact'>";
|
||||||
|
newContact += "<input type='text' class='no-line number' placeholder='Numéro de téléphone'>";
|
||||||
|
newContact += "<input type='text' class='no-line username' placeholder='Pseudo'>";
|
||||||
|
newContact += "<input type='text' class='no-line firstname' placeholder='Prénom'>";
|
||||||
|
newContact += "<input type='text' class='no-line lastname' placeholder='Nom'>";
|
||||||
|
newContact += "<input type='submit' class='primary no-line sub-number' value='Valider'>";
|
||||||
|
newContact += "</h4>";
|
||||||
|
|
||||||
|
/* (2) TODO: Contiendra la fiche relation complète */
|
||||||
|
var ficheRelation = "";
|
||||||
|
|
||||||
|
|
||||||
|
/* [1] Initialisation de l'inputChecker
|
||||||
|
=========================================================*/
|
||||||
|
// Instanciation
|
||||||
var ic = new inputChecker();
|
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 */
|
/* (1) On rédige la requête */
|
||||||
var uploadRequest = {
|
var uploadRequest = {
|
||||||
path: 'upload/call_log',
|
path: 'upload/call_log',
|
||||||
file: fileInput.files[0]
|
file: importCallLog.files[0]
|
||||||
};
|
};
|
||||||
|
|
||||||
/* (2) On effectue l'upload (import) */
|
/* (2) On effectue l'upload (import) */
|
||||||
api.send(uploadRequest, function(response){
|
api.send(uploadRequest, function(response){
|
||||||
console.log( response );
|
console.log( response );
|
||||||
|
// TODO: Gestion de l'ajout des fiches relation
|
||||||
});
|
});
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
Loading…
Reference in New Issue