diff --git a/public_html/js/includes/input-facebook-matrice.js b/public_html/js/includes/input-facebook-matrice.js index 0feac05..412d262 100644 --- a/public_html/js/includes/input-facebook-matrice.js +++ b/public_html/js/includes/input-facebook-matrice.js @@ -99,53 +99,38 @@ inputFacebookMatrice.prototype.storageToFields = function(){ /* (2) On construit le HTML de la matrice */ // Contiendra le HTML - var matrice_html = [""]; + var matrice_html = ["
"]; + var conA, conB, L, Ll, C, Cl; // {1} Pour chaque ligne // - for( var A = 0 ; A < contacts.length ; A++ ){ - var conA = contactData[A]; - - - matrice_html.push('
'); - - if( A > 0 ){ // Noms sur la première ligne (abscisses) - matrice_html.push(''); - }else // Sinon, - matrice_html.push(''); + for( L = 0, Ll = contacts.length ; L < Ll ; L++ ){ + conA = contactData[L]; // {2} Pour chaque case // - for( var B = 0 ; B < contacts.length ; B++ ){ if( B < contacts.length-1 ){ - var conB = contactData[B]; + for( C = L+1, Cl = contacts.length ; C < Cl ; C++ ){ + conB = contactData[C]; - // {3} Première colonne -> Intitulé des ordonnées // - if( A == 0 ){ - matrice_html.push(''); - }} + matrice_html.push( "" ); + + } - matrice_html.push(''); } - matrice_html.push('
'); - matrice_html.push(conA.username); - matrice_html.push(''); - matrice_html.push(''); - matrice_html.push(conB.username); - matrice_html.push(''); + // {3} Insertion // + matrice_html.push( ""); - matrice_html.push(" -1 ) - matrice_html.push(" checked"); - matrice_html.push(" >"); - matrice_html.push(""); + // Si lien actif, on le restitue + if( matriceData.hasOwnProperty(conA.uid) && matriceData[conA.uid].indexOf(conB.uid) > -1 ) + matrice_html.push( "checked='checked'"); - // {5} Cases vides (moitié supérieure droite) // - }else - matrice_html.push("
'); + matrice_html.push( '' ); /* (3) On affiche la matrice */ diff --git a/public_html/js/includes/input-phone-matrice.js b/public_html/js/includes/input-phone-matrice.js index 38df8c3..6086a0f 100644 --- a/public_html/js/includes/input-phone-matrice.js +++ b/public_html/js/includes/input-phone-matrice.js @@ -111,7 +111,7 @@ inputPhoneMatrice.prototype.storageToFields = function(){ conB = contactData[C]; // {3} Insertion // - matrice_html.push( " -1 ) @@ -119,7 +119,7 @@ inputPhoneMatrice.prototype.storageToFields = function(){ matrice_html.push( ">" ); - matrice_html.push( "