Modification de tous les managers de input.js post refactor et opti. de FormDeflater
This commit is contained in:
parent
3b4071dda1
commit
f5127af39b
File diff suppressed because one or more lines are too long
|
@ -61,8 +61,8 @@ miniFicheBuilder.setLayout(
|
|||
"\t</h5>"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t<input type='radio' name='sexe_min_@uid' data-name='sexe' id='sexeH_min_@uid'><label for='sexeH_min_@uid'>Homme</label>\n"+
|
||||
"\t\t   <input type='radio' name='sexe_min_@uid' data-name='sexe' id='sexeF_min_@uid'><label for='sexeF_min_@uid'>Femme</label>\n"+
|
||||
"\t\t<input type='radio' name='sexe_min_@uid' data-name='sexe' id='sexeH_min_@uid' value='H'><label for='sexeH_min_@uid'>Homme</label>\n"+
|
||||
"\t\t   <input type='radio' name='sexe_min_@uid' data-name='sexe' id='sexeF_min_@uid' value='F'><label for='sexeF_min_@uid'>Femme</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
|
||||
|
@ -126,24 +126,24 @@ miniFicheBuilder.setLayout(
|
|||
|
||||
"\t<h4 data-icon='a'>Type de relation</h4>\n"+
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype0_mini_@uid'><label for='reltype0_mini_@uid'>Père, mère ou équivalent</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype1_mini_@uid'><label for='reltype1_mini_@uid'>Frère ou soeur</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype2_mini_@uid'><label for='reltype2_mini_@uid'>Autre membre de la famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype3_mini_@uid'><label for='reltype3_mini_@uid'>Relation amoureuse</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype4_mini_@uid'><label for='reltype4_mini_@uid'>Collègue</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype5_mini_@uid'><label for='reltype5_mini_@uid'>Voisin</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype6_mini_@uid'><label for='reltype6_mini_@uid'>Ami</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype7_mini_@uid'><label for='reltype7_mini_@uid'>Copain</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype8_mini_@uid'><label for='reltype8_mini_@uid'>Autre : <input type='text' data-name='reltypeSpecial' placeholder='coéquipier de tennis, ..' value='@reltypespecial'></label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype0_mini_@uid' value='0'><label for='reltype0_mini_@uid'>Père, mère ou équivalent</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype1_mini_@uid' value='1'><label for='reltype1_mini_@uid'>Frère ou soeur</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype2_mini_@uid' value='2'><label for='reltype2_mini_@uid'>Autre membre de la famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype3_mini_@uid' value='3'><label for='reltype3_mini_@uid'>Relation amoureuse</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype4_mini_@uid' value='4'><label for='reltype4_mini_@uid'>Collègue</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype5_mini_@uid' value='5'><label for='reltype5_mini_@uid'>Voisin</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype6_mini_@uid' value='6'><label for='reltype6_mini_@uid'>Ami</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype7_mini_@uid' value='7'><label for='reltype7_mini_@uid'>Copain</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_mini_@uid' data-name='reltype' id='reltype8_mini_@uid' value='8'><label for='reltype8_mini_@uid'>Autre : <input type='text' data-name='reltypeSpecial' placeholder='coéquipier de tennis, ..' value='@reltypespecial'></label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tOù habite t-elle/il ?<br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locA_min_@uid'><label for='locA_min_@uid'>de 5 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locB_min_@uid'><label for='locB_min_@uid'>de 5 à 15 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locC_min_@uid'><label for='locC_min_@uid'>de 15 à 60 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locD_min_@uid'><label for='locD_min_@uid'>+ d'une heure</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locA_min_@uid' value='0'><label for='locA_min_@uid'>de 5 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locB_min_@uid' value='1'><label for='locB_min_@uid'>de 5 à 15 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locC_min_@uid' value='2'><label for='locC_min_@uid'>de 15 à 60 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_min_@uid' data-name='loc' id='locD_min_@uid' value='3'><label for='locD_min_@uid'>+ d'une heure</label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
"</article>");
|
||||
|
||||
|
@ -212,8 +212,8 @@ ficheBuilder.setLayout(
|
|||
"\t</h5>"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t<input type='radio' name='sexe_@uid' data-name='sexe' id='sexeH_@uid'><label for='sexeH_@uid'>Homme</label>\n"+
|
||||
"\t\t <input type='radio' name='sexe_@uid' data-name='sexe' id='sexeF_@uid'><label for='sexeF_@uid'>Femme</label>\n"+
|
||||
"\t\t<input type='radio' name='sexe_@uid' data-name='sexe' id='sexeH_@uid' value='H'><label for='sexeH_@uid'>Homme</label>\n"+
|
||||
"\t\t <input type='radio' name='sexe_@uid' data-name='sexe' id='sexeF_@uid' value='F'><label for='sexeF_@uid'>Femme</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
|
||||
|
@ -288,9 +288,9 @@ ficheBuilder.setLayout(
|
|||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tSituation familiale:<br>\n"+
|
||||
"\t\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t <input type='radio' name='famsit_@uid' data-name='famsit' id='famsitA_@uid'><label for='famsitA_@uid'>Seul</label><br>\n"+
|
||||
"\t\t <input type='radio' name='famsit_@uid' data-name='famsit' id='famsitB_@uid'><label for='famsitB_@uid'>En couple sans enfants</label><br>\n"+
|
||||
"\t\t <input type='radio' name='famsit_@uid' data-name='famsit' id='famsitC_@uid'><label for='famsitC_@uid'>En couple avec enfants</label>\n"+
|
||||
"\t\t <input type='radio' name='famsit_@uid' data-name='famsit' id='famsitA_@uid' value='0'><label for='famsitA_@uid'>Seul</label><br>\n"+
|
||||
"\t\t <input type='radio' name='famsit_@uid' data-name='famsit' id='famsitB_@uid' value='1'><label for='famsitB_@uid'>En couple sans enfants</label><br>\n"+
|
||||
"\t\t <input type='radio' name='famsit_@uid' data-name='famsit' id='famsitC_@uid' value='2'><label for='famsitC_@uid'>En couple avec enfants</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
|
@ -326,15 +326,15 @@ ficheBuilder.setLayout(
|
|||
|
||||
"\t<h4 data-icon='a'>Type de relation</h4>\n"+
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype0_@uid'><label for='reltype0_@uid'>Père, mère ou équivalent</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype1_@uid'><label for='reltype1_@uid'>Frère ou soeur</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype2_@uid'><label for='reltype2_@uid'>Autre membre de la famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype3_@uid'><label for='reltype3_@uid'>Relation amoureuse</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype4_@uid'><label for='reltype4_@uid'>Collègue</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype5_@uid'><label for='reltype5_@uid'>Voisin</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype6_@uid'><label for='reltype6_@uid'>Ami</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype7_@uid'><label for='reltype7_@uid'>Copain</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype8_@uid'><label for='reltype8_@uid'>Autre : <input type='text' data-name='reltypeSpecial' placeholder='coéquipier de tennis, ..' value='@reltypespecial'></label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype0_@uid' value='0'><label for='reltype0_@uid'>Père, mère ou équivalent</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype1_@uid' value='1'><label for='reltype1_@uid'>Frère ou soeur</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype2_@uid' value='2'><label for='reltype2_@uid'>Autre membre de la famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype3_@uid' value='3'><label for='reltype3_@uid'>Relation amoureuse</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype4_@uid' value='4'><label for='reltype4_@uid'>Collègue</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype5_@uid' value='5'><label for='reltype5_@uid'>Voisin</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype6_@uid' value='6'><label for='reltype6_@uid'>Ami</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype7_@uid' value='7'><label for='reltype7_@uid'>Copain</label><br>\n"+
|
||||
"\t\t <input type='radio' name='reltype_@uid' data-name='reltype' id='reltype8_@uid' value='8'><label for='reltype8_@uid'>Autre : <input type='text' data-name='reltypeSpecial' placeholder='coéquipier de tennis, ..' value='@reltypespecial'></label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h4 data-icon='m'>Où habite t-elle/il ?</h4>\n"+
|
||||
|
@ -346,10 +346,10 @@ ficheBuilder.setLayout(
|
|||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tOù habite t-elle/il ?<br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locA_@uid'><label for='locA_@uid'>de 5 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locB_@uid'><label for='locB_@uid'>de 5 à 15 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locC_@uid'><label for='locC_@uid'>de 15 à 60 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locD_@uid'><label for='locD_@uid'>+ d'une heure</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locA_@uid' value='0'><label for='locA_@uid'>de 5 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locB_@uid' value='1'><label for='locB_@uid'>de 5 à 15 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locC_@uid' value='2'><label for='locC_@uid'>de 15 à 60 minutes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='loc_@uid' data-name='loc' id='locD_@uid' value='3'><label for='locD_@uid'>+ d'une heure</label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
|
@ -361,102 +361,102 @@ ficheBuilder.setLayout(
|
|||
|
||||
"\t<h4 data-icon='d'>Contexte de rencontre</h4>\n"+
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte0_@uid'> <label for='contexte0_@uid'>De la même famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte1_@uid'> <label for='contexte1_@uid'>Grandi ensemble</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte2_@uid'> <label for='contexte2_@uid'>Par mon mari/ma femme/relation amoureuse</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte3_@uid'> <label for='contexte3_@uid'>Par mes parents</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte4_@uid'> <label for='contexte4_@uid'>Par mes enfants</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte5_@uid'> <label for='contexte5_@uid'>Par un ami</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte6_@uid'> <label for='contexte6_@uid'>Comme voisin</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte7_@uid'> <label for='contexte7_@uid'>Par d’autres membres de la famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte8_@uid'> <label for='contexte8_@uid'>Etudes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte9_@uid'> <label for='contexte9_@uid'>Etudes supérieures</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte0_@uid' value='0'><label for='contexte0_@uid'>De la même famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte1_@uid' value='1'><label for='contexte1_@uid'>Grandi ensemble</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte2_@uid' value='2'><label for='contexte2_@uid'>Par mon mari/ma femme/relation amoureuse</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte3_@uid' value='3'><label for='contexte3_@uid'>Par mes parents</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte4_@uid' value='4'><label for='contexte4_@uid'>Par mes enfants</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte5_@uid' value='5'><label for='contexte5_@uid'>Par un ami</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte6_@uid' value='6'><label for='contexte6_@uid'>Comme voisin</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte7_@uid' value='7'><label for='contexte7_@uid'>Par d’autres membres de la famille</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte8_@uid' value='8'><label for='contexte8_@uid'>Etudes</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte9_@uid' value='9'><label for='contexte9_@uid'>Etudes supérieures</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte10_@uid' value='10'><label for='contexte10_@uid'>Au travail</label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte10_@uid'><label for='contexte10_@uid'>Au travail</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte11_@uid'><label for='contexte11_@uid'>Internet (quel contexte ? préciser <input type='text' data-name='contextSpecial' placeholder='facebook, youtube, twitter, ..' value='@contextspecial0'>)</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte12_@uid'><label for='contexte12_@uid'>Par une association (quel type : <input type='text' data-name='contextSpecial' placeholder='aide à la personne, sport, ..' value='@contextspecial1'>)</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte13_@uid'><label for='contexte13_@uid'>Autre : <input type='text' data-name='contextSpecial' placeholder='vacances, ..' value='@contextspecial2'></label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte11_@uid' value='11'><label for='contexte11_@uid'>Internet (quel contexte ? préciser <input type='text' data-name='contextSpecial' placeholder='facebook, youtube, twitter, ..' value='@contextspecial0'>)</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte12_@uid' value='12'><label for='contexte12_@uid'>Par une association (quel type : <input type='text' data-name='contextSpecial' placeholder='aide à la personne, sport, ..' value='@contextspecial1'>)</label><br>\n"+
|
||||
"\t\t <input type='radio' name='contexte_@uid' data-name='context' id='contexte13_@uid' value='13'><label for='contexte13_@uid'>Autre : <input type='text' data-name='contextSpecial' placeholder='vacances, ..' value='@contextspecial2'></label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h4 data-icon='b'>Avec quelle fréquence discutez-vous avec cette personne ?</h4>\n"+
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tFace à face<br>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq0' id='freq01_@uid'><label for='freq01_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq0' id='freq02_@uid'><label for='freq02_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq0' id='freq03_@uid'><label for='freq03_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq0' id='freq04_@uid'><label for='freq04_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq' id='freq01_@uid' value='0'><label for='freq01_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq' id='freq02_@uid' value='1'><label for='freq02_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq' id='freq03_@uid' value='2'><label for='freq03_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq0_@uid' data-name='freq' id='freq04_@uid' value='3'><label for='freq04_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tTéléphone ou skype et équivalent<br>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq1' id='freq11_@uid'><label for='freq11_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq1' id='freq12_@uid'><label for='freq12_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq1' id='freq13_@uid'><label for='freq13_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq1' id='freq14_@uid'><label for='freq14_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq' id='freq11_@uid' value='4'><label for='freq11_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq' id='freq12_@uid' value='5'><label for='freq12_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq' id='freq13_@uid' value='6'><label for='freq13_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq1_@uid' data-name='freq' id='freq14_@uid' value='7'><label for='freq14_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tSMS, et équivalents<br>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq2' id='freq21_@uid'><label for='freq21_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq2' id='freq22_@uid'><label for='freq22_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq2' id='freq23_@uid'><label for='freq23_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq2' id='freq24_@uid'><label for='freq24_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq' id='freq21_@uid' value='8'><label for='freq21_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq' id='freq22_@uid' value='9'><label for='freq22_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq' id='freq23_@uid' value='10'><label for='freq23_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq2_@uid' data-name='freq' id='freq24_@uid' value='11'><label for='freq24_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tCourrier électronique<br>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq3' id='freq31_@uid'><label for='freq31_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq3' id='freq32_@uid'><label for='freq32_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq3' id='freq33_@uid'><label for='freq33_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq3' id='freq34_@uid'><label for='freq34_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq' id='freq31_@uid' value='12'><label for='freq31_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq' id='freq32_@uid' value='13'><label for='freq32_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq' id='freq33_@uid' value='14'><label for='freq33_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq3_@uid' data-name='freq' id='freq34_@uid' value='15'><label for='freq34_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tFacebook ou autre réseau social<br>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq4' id='freq41_@uid'><label for='freq41_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq4' id='freq42_@uid'><label for='freq42_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq4' id='freq43_@uid'><label for='freq43_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq4' id='freq44_@uid'><label for='freq44_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq' id='freq41_@uid' value='16'><label for='freq41_@uid'>plusieurs fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq' id='freq42_@uid' value='17'><label for='freq42_@uid'>1 fois par semaine</label>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq' id='freq43_@uid' value='18'><label for='freq43_@uid'>1 fois par mois</label>\n"+
|
||||
"\t\t <input type='radio' name='freq4_@uid' data-name='freq' id='freq44_@uid' value='19'><label for='freq44_@uid'>1 fois par an ou moins</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
|
||||
"\t<h4 data-icon='r'>Comment êtes-vous « connecté » à cette personne ?</h4>\n"+
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tSes coordonnées sont dans votre carnet d’adresse<br>\n"+
|
||||
"\t\t <input type='radio' name='connect1_@uid' data-name='connect0' id='connect11_@uid'><label for='connect11_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect1_@uid' data-name='connect0' id='connect12_@uid'><label for='connect12_@uid'>Non</label>\n"+
|
||||
"\t\t <input type='radio' name='connect1_@uid' data-name='connect' id='connect11_@uid' value='0'><label for='connect11_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect1_@uid' data-name='connect' id='connect12_@uid' value='1'><label for='connect12_@uid'>Non</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tSon numéro de mobile est enregistré sur votre mobile (ou vous-mêmes êtes sur le sien)<br>\n"+
|
||||
"\t\t <input type='radio' name='connect2_@uid' data-name='connect1' id='connect21_@uid'><label for='connect21_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect2_@uid' data-name='connect1' id='connect22_@uid'><label for='connect22_@uid'>Non</label>\n"+
|
||||
"\t\t <input type='radio' name='connect2_@uid' data-name='connect' id='connect21_@uid' value='2'><label for='connect21_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect2_@uid' data-name='connect' id='connect22_@uid' value='3'><label for='connect22_@uid'>Non</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tElle figure parmi vos amis facebook<br>\n"+
|
||||
"\t\t <input type='radio' name='connect3_@uid' data-name='connect2' id='connect31_@uid'><label for='connect31_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect3_@uid' data-name='connect2' id='connect32_@uid'><label for='connect32_@uid'>Non</label>\n"+
|
||||
"\t\t <input type='radio' name='connect3_@uid' data-name='connect' id='connect31_@uid' value='4'><label for='connect31_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect3_@uid' data-name='connect' id='connect32_@uid' value='5'><label for='connect32_@uid'>Non</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tElle figure parmi vos amis facebook et vous interagissez avec elle sur ce dispositif régulièrement<br>\n"+
|
||||
"\t\t <input type='radio' name='connect4_@uid' data-name='connect3' id='connect41_@uid'><label for='connect41_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect4_@uid' data-name='connect3' id='connect42_@uid'><label for='connect42_@uid'>Non</label>\n"+
|
||||
"\t\t <input type='radio' name='connect4_@uid' data-name='connect' id='connect41_@uid' value='6'><label for='connect41_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect4_@uid' data-name='connect' id='connect42_@uid' value='7'><label for='connect42_@uid'>Non</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tVous le suivez sur Twitter<br>\n"+
|
||||
"\t\t <input type='radio' name='connect5_@uid' data-name='connect4' id='connect51_@uid'><label for='connect51_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect5_@uid' data-name='connect4' id='connect52_@uid'><label for='connect52_@uid'>Non</label>\n"+
|
||||
"\t\t <input type='radio' name='connect5_@uid' data-name='connect' id='connect51_@uid' value='8'><label for='connect51_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect5_@uid' data-name='connect' id='connect52_@uid' value='9'><label for='connect52_@uid'>Non</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\tVous communiquez avec cette personne sur Twitter<br>\n"+
|
||||
"\t\t <input type='radio' name='connect6_@uid' data-name='connect5' id='connect61_@uid'><label for='connect61_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect6_@uid' data-name='connect5' id='connect62_@uid'><label for='connect62_@uid'>Non</label>\n"+
|
||||
"\t\t <input type='radio' name='connect6_@uid' data-name='connect' id='connect61_@uid' value='10'><label for='connect61_@uid'>Oui</label>\n"+
|
||||
"\t\t <input type='radio' name='connect6_@uid' data-name='connect' id='connect62_@uid' value='11'><label for='connect62_@uid'>Non</label>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
function inputPhoneContact(a,c){this.container=a;this.nav_container=c}inputPhoneContact.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null};
|
||||
inputPhoneContact.prototype.fieldsToStorage=function(){console.log("CONTACTS: FIELDS TO STORAGE");for(var a=$$("article.contact-panel .new-contact"),c=0;c<a.length;c++){var b=(new FormDeflater(a[c],["input"],["data-name"])).deflate(),d=0<b.number.value.length;if(d=d&&0<b.username.value.length+b.firstname.value.length+b.lastname.value.length)d={uid:parseInt(b.uid.value),number:b.number.value,username:b.username.value,firstname:b.firstname.value,lastname:b.lastname.value,call:parseInt(b.call.value),
|
||||
sms:parseInt(b.sms.value),countcall:parseInt(b.countcall.value),countsms:parseInt(b.countsms.value)},d.hash=crc32(JSON.stringify(d)),lsi.set("contacts",parseInt(b.uid.value),d)}};
|
||||
inputPhoneContact.prototype.fieldsToStorage=function(){console.log("CONTACTS: FIELDS TO STORAGE");for(var a=$$("article.contact-panel .new-contact"),c=0;c<a.length;c++){var b=(new FormDeflater(a[c],["input"],["data-name"])).deflate(),d=0<b.number.length;if(d=d&&0<b.username.length+b.firstname.length+b.lastname.length)d={uid:parseInt(b.uid),number:b.number,username:b.username,firstname:b.firstname,lastname:b.lastname,call:parseInt(b.call),sms:parseInt(b.sms),countcall:parseInt(b.countcall),countsms:parseInt(b.countsms)},
|
||||
d.hash=crc32(JSON.stringify(d)),lsi.set("contacts",parseInt(b.uid),d)}};
|
||||
inputPhoneContact.prototype.add=function(a){console.log("CONTACTS: ADD");if(null==a||null==a.uid||isNaN(a.uid))return!1;a.number=null!=a.number?a.number:"";a.username=null!=a.username?a.username:"";a.firstname=null!=a.firstname?a.firstname:"";a.lastname=null!=a.lastname?a.lastname:"";a.call=null!=a.call?a.call:-1;a.sms=null!=a.sms?a.sms:-1;a.countcall=null!=a.countcall?a.countcall:0;a.countsms=null!=a.countsms?a.countsms:0;this.container.innerHTML+=contactBuilder.build(a);a=$$("article.contact-panel .new-contact");
|
||||
for(var c=this,b=0;b<a.length;b++)a[b].removeEventListener("click",function(a){c.nav(a.target);c.handler(a.target)},!1),a[b].addEventListener("click",function(a){c.nav(a.target);c.handler(a.target)},!1)};inputPhoneContact.prototype.storageToFields=function(){console.log("CONTACTS: STORAGE TO FIELDS");var a=lsi.keys("contacts");this.container.innerHTML="";for(var c=this.selected+10,b=this.selected;b<c&&b<a.length;b++)this.add(lsi.get("contacts",a[b]));c>=a.length&&this.add({uid:a.length});this.updateNavBar()};
|
||||
inputPhoneContact.prototype.nav=function(a){if(null==a||!1===a.getData("n")||isNaN(a.getData("n"))||"nav-contact"!=a.parentNode.id)return!1;for(var c=$$("#nav-contact > span.active"),b=0;b<c.length;b++)c[b].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))};
|
||||
|
|
|
@ -31,33 +31,33 @@ inputPhoneContact.prototype.fieldsToStorage = function(){
|
|||
var deflated = deflater.deflate();
|
||||
|
||||
// Le numéro n'est pas vide
|
||||
var validForm = deflated.number.value.length > 0;
|
||||
var validForm = deflated.number.length > 0;
|
||||
// ET le pseudo et/ou le prénom et/ou le nom n'est pas vide
|
||||
validForm = validForm && deflated.username.value.length+deflated.firstname.value.length+deflated.lastname.value.length > 0;
|
||||
validForm = validForm && deflated.username.length+deflated.firstname.length+deflated.lastname.length > 0;
|
||||
|
||||
// Si le formulaire n'est pas valide, on ne l'enregistre pas
|
||||
if( !validForm ) continue;
|
||||
|
||||
// {4} On récupère et met en forme les valeurs du deflater //
|
||||
var obj = {
|
||||
uid: parseInt(deflated.uid.value),
|
||||
number: deflated.number.value,
|
||||
username: deflated.username.value,
|
||||
firstname: deflated.firstname.value,
|
||||
lastname: deflated.lastname.value,
|
||||
uid: parseInt(deflated.uid),
|
||||
number: deflated.number,
|
||||
username: deflated.username,
|
||||
firstname: deflated.firstname,
|
||||
lastname: deflated.lastname,
|
||||
|
||||
call: parseInt(deflated.call.value),
|
||||
sms: parseInt(deflated.sms.value),
|
||||
call: parseInt(deflated.call),
|
||||
sms: parseInt(deflated.sms),
|
||||
|
||||
countcall: parseInt(deflated.countcall.value),
|
||||
countsms: parseInt(deflated.countsms.value)
|
||||
countcall: parseInt(deflated.countcall),
|
||||
countsms: parseInt(deflated.countsms)
|
||||
};
|
||||
|
||||
/* (5) On calcule et ajoute le hash des données */
|
||||
obj.hash = crc32( JSON.stringify(obj) );
|
||||
|
||||
// {6} On enregistre les données dans le 'localStorage' //
|
||||
lsi.set('contacts', parseInt(deflated.uid.value), obj);
|
||||
lsi.set('contacts', parseInt(deflated.uid), obj);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
function inputPhoneFiche(a,b){this.container=a;this.nav_container=b}
|
||||
inputPhoneFiche.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:[defTrue,defFalse],age:".",job:".",famsit:[defTrue,defFalse,defFalse],studies:".",reltype:[defTrue,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse],reltypeSpecial:"",city:"",loc:[defTrue,defFalse,defFalse,defFalse],duration:["",""],context:[defTrue,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,
|
||||
defFalse],contextSpecial:["","",""],freq:[[defTrue,defFalse,defFalse,defFalse],[defTrue,defFalse,defFalse,defFalse],[defTrue,defFalse,defFalse,defFalse],[defTrue,defFalse,defFalse,defFalse],[defTrue,defFalse,defFalse,defFalse]],connect:[[defFalse,defTrue],[defFalse,defTrue],[defFalse,defTrue],[defFalse,defTrue],[defFalse,defTrue],[defFalse,defTrue]],connectSpecial:["",""],timestamp:0,valid:!1}};
|
||||
inputPhoneFiche.prototype.fieldsToStorage=function(){console.log("FICHE: FIELDS TO STORAGE");for(var a=$$("article.relation-panel .fiche-relation"),b=0;b<a.length;b++){var c=(new FormDeflater(a[b],["input","select"],["data-name"])).deflate(),e=crc32(JSON.stringify(c)),d=lsi.get("fiches",c.uid.value);if(!1!==d){if(null!=d.hash&&d.hash==e)break;c={contact:parseInt(c.contact.value),uid:parseInt(c.uid.value),sexe:c.sexe,age:c.age.value,job:c.job.value,famsit:c.famsit,studies:c.studies.value,reltype:c.reltype,
|
||||
reltypeSpecial:c.reltypeSpecial.value,city:c.city.value,loc:c.loc,duration:[c.duration[0].value,c.duration[1].value],context:c.context,contextSpecial:[c.contextSpecial[0].value,c.contextSpecial[1].value,c.contextSpecial[2].value],freq:[c.freq0,c.freq1,c.freq2,c.freq3,c.freq4],connect:[c.connect0,c.connect1,c.connect2,c.connect3,c.connect4,c.connect5],connectSpecial:[c.connectSpecial[0].value,c.connectSpecial[1].value],hash:e};c.valid=this.check(c);0<diff(d,c).length&&(console.warn("> FICHE UPDATE"),
|
||||
c.timestamp=Date.now());lsi.set("fiches",c.uid,c)}}};
|
||||
function inputPhoneFiche(a,b){this.container=a;this.nav_container=b}inputPhoneFiche.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:"H",age:".",job:".",famsit:"0",studies:".",reltype:"0",reltypeSpecial:"",city:"",loc:"0",duration:["",""],context:"0",contextSpecial:["","",""],freq:["0","0","0","0","0"],connect:"000000".split(""),connectSpecial:["",""],timestamp:0,valid:!1}};
|
||||
inputPhoneFiche.prototype.fieldsToStorage=function(){console.log("FICHE: FIELDS TO STORAGE");for(var a=$$("article.relation-panel .fiche-relation"),b=0;b<a.length;b++){var c=(new FormDeflater(a[b],["input","select"],["data-name"])).deflate(),f=crc32(JSON.stringify(c)),d=lsi.get("fiches",c.uid);if(!1!==d){if(null!=d.hash&&d.hash==f)break;c={contact:parseInt(c.contact),uid:parseInt(c.uid),sexe:c.sexe,age:c.age,job:c.job,famsit:c.famsit,studies:c.studies,reltype:c.reltype,reltypeSpecial:c.reltypeSpecial,
|
||||
city:c.city,loc:c.loc,duration:c.duration,context:c.context,contextSpecial:c.contextSpecial,freq:c.freq,connect:c.connect,connectSpecial:c.connectSpecial,hash:f};c.valid=this.check(c);0<diff(d,c,["hash","valid","timestamp"]).length&&(console.log(diff(d,c,["hash","valid","timestamp"])),console.warn("> FICHE UPDATE"),c.timestamp=Date.now());lsi.set("fiches",c.uid,c)}}};
|
||||
inputPhoneFiche.prototype.add=function(a){console.log("FICHE: ADD");if(null==a.uid||null==a.contact)return!1;a.city=null!=a.city?a.city:this.defaultData.city;a.duration[0]=null!=a.duration[0]?a.duration[0]:this.defaultData.duration[0];a.duration[1]=null!=a.duration[1]?a.duration[1]:this.defaultData.duration[1];a.reltypeSpecial=null!=a.reltypeSpecial?a.reltypeSpecial:this.defaultData.reltypeSpecial;a.contextSpecial[0]=null!=a.contextSpecial[0]?a.contextSpecial[0]:this.defaultData.contextSpecial[0];
|
||||
a.contextSpecial[1]=null!=a.contextSpecial[1]?a.contextSpecial[1]:this.defaultData.contextSpecial[1];a.contextSpecial[2]=null!=a.contextSpecial[2]?a.contextSpecial[2]:this.defaultData.contextSpecial[2];a.connectSpecial[0]=null!=a.connectSpecial[0]?a.connectSpecial[0]:this.defaultData.connectSpecial[0];a.connectSpecial[1]=null!=a.connectSpecial[1]?a.connectSpecial[1]:this.defaultData.connectSpecial[1];a.job=null!=a.job?a.job:this.defaultData.job;a.studies=null!=a.studies?a.studies:this.defaultData.studies;
|
||||
a.age=null!=a.age?a.age:this.defaultData.age;a.sexe=null!=a.sexe?a.sexe:this.defaultData.sexe;a.famsit=null!=a.famsit?a.famsit:this.defaultData.famsit;a.reltype=null!=a.reltype?a.reltype:this.defaultData.reltype;a.loc=null!=a.loc?a.loc:this.defaultData.loc;a.context=null!=a.context?a.context:this.defaultData.context;a.freq=null!=a.freq?a.freq:this.defaultData.freq;a.connect=null!=a.connect?a.connect:this.defaultData.connect;var b=lsi.get("contacts",a.contact);if(!1===b)return!1;this.container.innerHTML+=
|
||||
ficheBuilder.build({firstname:b.firstname,lastname:b.lastname,username:0==b.username.length?"":"("+b.username+")",countcall:b.countcall,countsms:b.countsms,uid:a.uid,contact:a.contact,city:a.city,duration0:a.duration[0],duration1:a.duration[1],reltypespecial:a.reltypeSpecial,contextspecial0:a.contextSpecial[0],contextspecial1:a.contextSpecial[1],contextspecial2:a.contextSpecial[2],connectspecial0:a.connectSpecial[0],connectspecial1:a.connectSpecial[1]});b=$('article.fiche-relation input[data-name="uid"][value="'+
|
||||
a.uid+'"] ~ h5>span>select[data-name="job"]>option[value="'+a.job+'"]');null!=b&&b.setAttribute("selected","selected");b=$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="studies"]>option[value="'+a.studies+'"]');null!=b&&b.setAttribute("selected","selected");b=$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="age"]>option[value="'+a.age+'"]');null!=b&&b.setAttribute("selected","selected");for(var c=$$('article.fiche-relation input[data-name="uid"][value="'+
|
||||
a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]'),b=0;b<c.length&&b<a.sexe.length;b++)a.sexe[b].status?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="famsit"]');for(b=0;b<c.length&&b<a.famsit.length;b++)a.famsit[b].status?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');
|
||||
for(b=0;b<c.length&&b<a.reltype.length;b++)a.reltype[b].status?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');for(b=0;b<c.length&&b<a.loc.length;b++)a.loc[b].status?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="context"]');for(b=0;b<
|
||||
c.length&&b<a.context.length;b++)a.context[b].status?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");for(c=0;c<a.freq.length;c++)for(var e=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="freq'+c+'"]'),b=0;b<e.length&&b<a.freq[c].length;b++)a.freq[c][b].status?e[b].setAttribute("checked","checked"):e[b].removeAttribute("checked");for(c=0;c<a.connect.length;c++)for(e=$$('article.fiche-relation input[data-name="uid"][value="'+
|
||||
a.uid+'"] ~ h5>input[type="radio"][data-name="connect'+c+'"]'),b=0;b<e.length&&b<a.connect[c].length;b++)a.connect[c][b].status?e[b].setAttribute("checked","checked"):e[b].removeAttribute("checked")};inputPhoneFiche.prototype.storageToFields=function(){console.log("FICHE: STORAGE TO FIELDS");var a=lsi["export"]("fiches");this.container.innerHTML="";for(var b in a)a[b].uid==this.selected&&this.add(a[b]);this.updateNavBar()};
|
||||
inputPhoneFiche.prototype.sync=function(){console.log("FICHE: SYNC");var a=lsi["export"]("contacts"),b=[],c;for(c in a){if(-1<a[c].call){var e=a[c].call;b.push(e);var d=lsi.get("fiches",e);null==d&&(d=this.defaultData);d.uid=e;d.contact=parseInt(c);lsi.set("fiches",e,d)}-1<a[c].sms&&(e=10+a[c].sms,b.push(e),d=lsi.get("fiches",e),null==d&&(d=this.defaultData),d.uid=e,d.contact=parseInt(c),lsi.set("fiches",e,d))}if(20>b.length)for(c in a){for(a=0;-1<b.indexOf(a)&&20>a;)a++;b.push(a);d=lsi.get("fiches",
|
||||
a);null==d&&(d=this.defaultData);d.uid=a;d.contact=c;lsi.set("fiches",a,d);if(20<=b.length)break}var d=lsi["export"]("fiches"),f;for(f in d)miniData=lsi.get("mini-fiches",d[f].contact),d[f].timestamp>=miniData.timestamp?(miniData.sexe=d[f].sexe,miniData.age=d[f].age,miniData.studies=d[f].studies,miniData.loc=d[f].loc,miniData.reltype=d[f].reltype,miniData.reltypeSpecial=d[f].reltypeSpecial):(d[f].sexe=miniData.sexe,d[f].age=miniData.age,d[f].studies=miniData.studies,d[f].loc=miniData.loc,d[f].reltype=
|
||||
miniData.reltype,d[f].reltypeSpecial=miniData.reltypeSpecial),lsi.set("mini-fiches",d[f].contact,miniData),lsi.set("fiches",f,d[f]);for(f in d)b=lsi.get("contacts",d[f].contact),null!=b&&-1!=b.sms&&-1!=b.call&&(b=10>parseInt(f)?10+b.sms:b.call,b=d[b],b.timestamp>=d[f].timestamp||(c=d[f],c.uid=b.uid,lsi.set("fiches",b.uid,c)))};
|
||||
a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]'),b=0;b<c.length;b++)c[b].value==a.sexe?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="famsit"]');for(b=0;b<c.length;b++)c[b].value==a.famsit?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');
|
||||
for(b=0;b<c.length;b++)c[b].value==a.reltype?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');for(b=0;b<c.length;b++)c[b].value==a.loc?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="context"]');for(b=0;b<c.length;b++)c[b].value==a.context?
|
||||
c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="freq"]');for(b=0;b<c.length;b++)c[b].value==a.freq?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="connect"]');for(b=0;b<c.length;b++)c[b].value==a.connect?c[b].setAttribute("checked","checked"):
|
||||
c[b].removeAttribute("checked")};inputPhoneFiche.prototype.storageToFields=function(){console.log("FICHE: STORAGE TO FIELDS");var a=lsi["export"]("fiches");this.container.innerHTML="";for(var b in a)a[b].uid==this.selected&&this.add(a[b]);this.updateNavBar()};
|
||||
inputPhoneFiche.prototype.sync=function(){console.log("FICHE: SYNC");var a=lsi["export"]("contacts"),b=[],c;for(c in a){if(-1<a[c].call){var f=a[c].call;b.push(f);var d=lsi.get("fiches",f);null==d&&(d=this.defaultData);d.uid=f;d.contact=parseInt(c);lsi.set("fiches",f,d)}-1<a[c].sms&&(f=10+a[c].sms,b.push(f),d=lsi.get("fiches",f),null==d&&(d=this.defaultData),d.uid=f,d.contact=parseInt(c),lsi.set("fiches",f,d))}if(20>b.length)for(c in a){for(a=0;-1<b.indexOf(a)&&20>a;)a++;b.push(a);d=lsi.get("fiches",
|
||||
a);null==d&&(d=this.defaultData);d.uid=a;d.contact=c;lsi.set("fiches",a,d);if(20<=b.length)break}var d=lsi["export"]("fiches"),e;for(e in d)miniData=lsi.get("mini-fiches",d[e].contact),d[e].timestamp>miniData.timestamp?(miniData.sexe=d[e].sexe,miniData.age=d[e].age,miniData.studies=d[e].studies,miniData.loc=d[e].loc,miniData.reltype=d[e].reltype,miniData.reltypeSpecial=d[e].reltypeSpecial):(d[e].sexe=miniData.sexe,d[e].age=miniData.age,d[e].studies=miniData.studies,d[e].loc=miniData.loc,d[e].reltype=
|
||||
miniData.reltype,d[e].reltypeSpecial=miniData.reltypeSpecial),lsi.set("mini-fiches",d[e].contact,miniData),lsi.set("fiches",e,d[e]);for(e in d)b=lsi.get("contacts",d[e].contact),null!=b&&-1!=b.sms&&-1!=b.call&&(b=10>parseInt(e)?10+b.sms:b.call,b=d[b],b.timestamp>=d[e].timestamp||(c=d[e],c.uid=b.uid,lsi.set("fiches",b.uid,c)))};
|
||||
inputPhoneFiche.prototype.nav=function(a){if(null==a||!1===a.getData("n")||isNaN(a.getData("n"))||"nav-fiche"!=a.parentNode.id)return!1;for(var b=$$("#nav-fiche > span.active"),c=0;c<b.length;c++)b[c].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))};
|
||||
inputPhoneFiche.prototype.updateNavBar=function(){var a=lsi["export"]("fiches"),b=lsi.keys("fiches").length;if($$("#nav-fiche [data-n]").length!=b){this.nav_container.innerHTML="<span>APPELS</span>";for(var c=0;c<b;c++)9==c?this.nav_container.innerHTML+='<span data-n="'+c+'" class="lc">'+(c%10+1)+"</span> ":(10==c&&(this.nav_container.innerHTML+='<span class="fc">SMS</span>'),this.nav_container.innerHTML+='<span data-n="'+c+'">'+(c%10+1)+"</span>")}for(var e in a)b=$('#nav-fiche [data-n="'+
|
||||
a[e].uid+'"]'),null!=b&&(!0===a[e].valid?b.addClass("done"):b.remClass("done"));this.nav($('#nav-fiche [data-n="'+this.selected+'"]'))};
|
||||
inputPhoneFiche.prototype.updateNavBar=function(){var a=lsi["export"]("fiches"),b=lsi.keys("fiches").length;if($$("#nav-fiche [data-n]").length!=b){this.nav_container.innerHTML="<span>APPELS</span>";for(var c=0;c<b;c++)9==c?this.nav_container.innerHTML+='<span data-n="'+c+'" class="lc">'+(c%10+1)+"</span> ":(10==c&&(this.nav_container.innerHTML+='<span class="fc">SMS</span>'),this.nav_container.innerHTML+='<span data-n="'+c+'">'+(c%10+1)+"</span>")}for(var f in a)b=$('#nav-fiche [data-n="'+
|
||||
a[f].uid+'"]'),null!=b&&(!0===a[f].valid?b.addClass("done"):b.remClass("done"));this.nav($('#nav-fiche [data-n="'+this.selected+'"]'))};
|
||||
inputPhoneFiche.prototype.check=function(a){if(2>a.city.length||isNaN(parseInt(a.duration[0]))&&0<a.duration[0].length||isNaN(parseInt(a.duration[1]))&&0<a.duration[1].length||0==a.duration[0].length+a.duration[1].length||"."==a.job||"."==a.studies||"."==a.age||!checkRadioValue(a.sexe)||!checkRadioValue(a.famsit)||!checkRadioValue(a.reltype)||!checkRadioValue(a.loc)||!checkRadioValue(a.context))return!1;for(var b=0;b<a.freq.length;b++)if(!checkRadioValue(a.freq[b]))return!1;for(b=0;b<a.connect.length;b++)if(!checkRadioValue(a.connect[b]))return!1;
|
||||
return a.reltype[8].status&&2>a.reltypeSpecial.length||a.context[11].status&&2>a.contextSpecial[0].length||a.context[12].status&&2>a.contextSpecial[1].length||a.context[13].status&&2>a.contextSpecial[2].length?!1:!0};inputPhoneFiche.prototype.attach=function(a){console.log("FICHE: ATTACH");lsi.createDataset("fiches");this.storageToFields();this.handler=a;var b=this,b=this;this.nav_container.addEventListener("click",function(a){b.nav(a.target);b.handler(a.target)},!1)};
|
||||
|
|
|
@ -13,37 +13,23 @@ inputPhoneFiche.prototype = {
|
|||
selected: 0, // UID de la FICHE sélectionnée
|
||||
handler: null, // Fonction pour l'enregistrement et la synchronisation des données
|
||||
defaultData: { // Valeurs par défaut
|
||||
sexe: [ defTrue, defFalse],
|
||||
sexe: 'H',
|
||||
age: '.',
|
||||
job: '.',
|
||||
famsit: [ defTrue, defFalse, defFalse ], // Choix 1 à 3
|
||||
famsit: '0', // Choix 1 à 3
|
||||
studies: '.',
|
||||
reltype: [ defTrue, defFalse, defFalse, defFalse, defFalse,
|
||||
defFalse, defFalse, defFalse, defFalse], // Choix 1 à 9
|
||||
reltype: '0', // Choix 1 à 9
|
||||
reltypeSpecial: '',
|
||||
city: '',
|
||||
loc: [ defTrue, defFalse, defFalse, defFalse ],
|
||||
loc: '0',
|
||||
duration: ['', ''],
|
||||
context: [ defTrue, defFalse, defFalse, defFalse, defFalse,
|
||||
defFalse, defFalse, defFalse, defFalse, defFalse,
|
||||
defFalse, defFalse, defFalse, defFalse], // Choix 1 à 14
|
||||
context: '0', // Choix 1 à 14
|
||||
contextSpecial: ['', '', ''],
|
||||
freq: [
|
||||
[ defTrue, defFalse, defFalse, defFalse ],
|
||||
[ defTrue, defFalse, defFalse, defFalse ],
|
||||
[ defTrue, defFalse, defFalse, defFalse ],
|
||||
[ defTrue, defFalse, defFalse, defFalse ],
|
||||
[ defTrue, defFalse, defFalse, defFalse ]],
|
||||
connect: [
|
||||
[ defFalse, defTrue ],
|
||||
[ defFalse, defTrue ],
|
||||
[ defFalse, defTrue ],
|
||||
[ defFalse, defTrue ],
|
||||
[ defFalse, defTrue ],
|
||||
[ defFalse, defTrue ]],
|
||||
freq: ['0', '0', '0', '0', '0'],
|
||||
connect: ['0', '0', '0', '0', '0', '0'],
|
||||
connectSpecial: ['', ''],
|
||||
timestamp: 0,
|
||||
valid: false
|
||||
timestamp: 0,
|
||||
valid: false
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -70,7 +56,7 @@ inputPhoneFiche.prototype.fieldsToStorage = function(){
|
|||
|
||||
|
||||
// {4} On récupère les données du LSI si elles existent //
|
||||
var existingData = lsi.get('fiches', deflated.uid.value);
|
||||
var existingData = lsi.get('fiches', deflated.uid);
|
||||
|
||||
// Si n'existe pas, on passe au suivant
|
||||
if( existingData === false )
|
||||
|
@ -84,47 +70,24 @@ inputPhoneFiche.prototype.fieldsToStorage = function(){
|
|||
|
||||
|
||||
var obj = {
|
||||
contact: parseInt(deflated.contact.value),
|
||||
uid: parseInt(deflated.uid.value),
|
||||
sexe: deflated.sexe, // Choix 1 à 2
|
||||
age: deflated.age.value,
|
||||
job: deflated.job.value,
|
||||
famsit: deflated.famsit, // Choix 1 à 3
|
||||
studies: deflated.studies.value,
|
||||
reltype: deflated.reltype, // Choix 1 à 9
|
||||
reltypeSpecial: deflated.reltypeSpecial.value,
|
||||
city: deflated.city.value,
|
||||
loc: deflated.loc, // Choix 1 à 3
|
||||
duration: [
|
||||
deflated.duration[0].value, // Durée de la relation en mois
|
||||
deflated.duration[1].value // Durée de la relation en années
|
||||
],
|
||||
context: deflated.context, // Choix 1 à 14
|
||||
contextSpecial: [
|
||||
deflated.contextSpecial[0].value, // Valeur du contexte si context[11]
|
||||
deflated.contextSpecial[1].value, // Valeur du contexte si context[12]
|
||||
deflated.contextSpecial[2].value // Valeur du contexte si context[13]
|
||||
],
|
||||
freq: [
|
||||
deflated.freq0, // Choix 1 à 4
|
||||
deflated.freq1, // Choix 1 à 4
|
||||
deflated.freq2, // Choix 1 à 4
|
||||
deflated.freq3, // Choix 1 à 4
|
||||
deflated.freq4 // Choix 1 à 4
|
||||
],
|
||||
connect: [
|
||||
deflated.connect0, // Choix 1 à 2
|
||||
deflated.connect1, // Choix 1 à 2
|
||||
deflated.connect2, // Choix 1 à 2
|
||||
deflated.connect3, // Choix 1 à 2
|
||||
deflated.connect4, // Choix 1 à 2
|
||||
deflated.connect5 // Choix 1 à 2
|
||||
],
|
||||
connectSpecial: [
|
||||
deflated.connectSpecial[0].value,
|
||||
deflated.connectSpecial[1].value
|
||||
],
|
||||
hash: deflatedHash
|
||||
contact: parseInt(deflated.contact),
|
||||
uid: parseInt(deflated.uid),
|
||||
sexe: deflated.sexe,
|
||||
age: deflated.age,
|
||||
job: deflated.job,
|
||||
famsit: deflated.famsit,
|
||||
studies: deflated.studies,
|
||||
reltype: deflated.reltype,
|
||||
reltypeSpecial: deflated.reltypeSpecial,
|
||||
city: deflated.city,
|
||||
loc: deflated.loc,
|
||||
duration: deflated.duration,
|
||||
context: deflated.context,
|
||||
contextSpecial: deflated.contextSpecial,
|
||||
freq: deflated.freq,
|
||||
connect: deflated.connect,
|
||||
connectSpecial: deflated.connectSpecial,
|
||||
hash: deflatedHash
|
||||
};
|
||||
|
||||
|
||||
|
@ -132,7 +95,8 @@ inputPhoneFiche.prototype.fieldsToStorage = function(){
|
|||
obj.valid = this.check(obj);
|
||||
|
||||
// On met à jour la date de modification, si on a pas qu'@uid de différent
|
||||
if( diff(existingData, obj).length > 0 ){
|
||||
if( diff(existingData, obj, ['hash', 'valid', 'timestamp']).length > 0 ){
|
||||
console.log( diff(existingData, obj, ['hash', 'valid', 'timestamp']) );
|
||||
console.warn('> FICHE UPDATE');
|
||||
obj.timestamp = Date.now();
|
||||
}
|
||||
|
@ -239,54 +203,50 @@ inputPhoneFiche.prototype.add = function(objectData){
|
|||
|
||||
/* {9} On sélectionna la valeur des boutons <radio> pour le SEXE */
|
||||
var sexeCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]');
|
||||
for( var i = 0 ; i < sexeCreated.length && i < objectData.sexe.length ; i++ )
|
||||
if( objectData.sexe[i].status ) sexeCreated[i].setAttribute('checked', 'checked');
|
||||
else sexeCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < sexeCreated.length ; i++ )
|
||||
if( sexeCreated[i].value == objectData.sexe ) sexeCreated[i].setAttribute('checked', 'checked');
|
||||
else sexeCreated[i].removeAttribute('checked');
|
||||
|
||||
|
||||
/* {10} On sélectionna la valeur des boutons <radio> pour la SITUATION FAMILIALE */
|
||||
var famsitCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="famsit"]');
|
||||
for( var i = 0 ; i < famsitCreated.length && i < objectData.famsit.length ; i++ )
|
||||
if( objectData.famsit[i].status ) famsitCreated[i].setAttribute('checked', 'checked');
|
||||
else famsitCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < famsitCreated.length ; i++ )
|
||||
if( famsitCreated[i].value == objectData.famsit ) famsitCreated[i].setAttribute('checked', 'checked');
|
||||
else famsitCreated[i].removeAttribute('checked');
|
||||
|
||||
|
||||
/* {11} On sélectionna la valeur des boutons <radio> pour le TYPE DE RELATION */
|
||||
var reltypeCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');
|
||||
for( var i = 0 ; i < reltypeCreated.length && i < objectData.reltype.length ; i++ )
|
||||
if( objectData.reltype[i].status ) reltypeCreated[i].setAttribute('checked', 'checked');
|
||||
else reltypeCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < reltypeCreated.length ; i++ )
|
||||
if( reltypeCreated[i].value == objectData.reltype ) reltypeCreated[i].setAttribute('checked', 'checked');
|
||||
else reltypeCreated[i].removeAttribute('checked');
|
||||
|
||||
|
||||
/* {12} On sélectionna la valeur des boutons <radio> pour la LOCATION */
|
||||
var locCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');
|
||||
for( var i = 0 ; i < locCreated.length && i < objectData.loc.length ; i++ )
|
||||
if( objectData.loc[i].status ) locCreated[i].setAttribute('checked', 'checked');
|
||||
else locCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < locCreated.length ; i++ )
|
||||
if( locCreated[i].value == objectData.loc ) locCreated[i].setAttribute('checked', 'checked');
|
||||
else locCreated[i].removeAttribute('checked');
|
||||
|
||||
|
||||
/* {13} On sélectionna la valeur des boutons <radio> pour le CONTEXTE DE RENCONTRE */
|
||||
var contextCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="context"]');
|
||||
for( var i = 0 ; i < contextCreated.length && i < objectData.context.length ; i++ )
|
||||
if( objectData.context[i].status ) contextCreated[i].setAttribute('checked', 'checked');
|
||||
else contextCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < contextCreated.length ; i++ )
|
||||
if( contextCreated[i].value == objectData.context ) contextCreated[i].setAttribute('checked', 'checked');
|
||||
else contextCreated[i].removeAttribute('checked');
|
||||
|
||||
|
||||
/* {14} On sélectionna la valeur des boutons <radio> pour les FREQUENCES */
|
||||
for( var f = 0 ; f < objectData.freq.length ; f++ ){
|
||||
var freqCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="freq'+f+'"]');
|
||||
for( var i = 0 ; i < freqCreated.length && i < objectData.freq[f].length ; i++ )
|
||||
if( objectData.freq[f][i].status ) freqCreated[i].setAttribute('checked', 'checked');
|
||||
else freqCreated[i].removeAttribute('checked');
|
||||
}
|
||||
var freqCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="freq"]');
|
||||
for( var i = 0 ; i < freqCreated.length ; i++ )
|
||||
if( freqCreated[i].value == objectData.freq ) freqCreated[i].setAttribute('checked', 'checked');
|
||||
else freqCreated[i].removeAttribute('checked');
|
||||
|
||||
/* {15} On sélectionna la valeur des boutons <radio> pour les CONNECTIONS */
|
||||
for( var c = 0 ; c < objectData.connect.length ;c++ ){
|
||||
var connectCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="connect'+c+'"]');
|
||||
for( var i = 0 ; i < connectCreated.length && i < objectData.connect[c].length ; i++ )
|
||||
if( objectData.connect[c][i].status ) connectCreated[i].setAttribute('checked', 'checked');
|
||||
else connectCreated[i].removeAttribute('checked');
|
||||
}
|
||||
var connectCreated = $$('article.fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="connect"]');
|
||||
for( var i = 0 ; i < connectCreated.length ; i++ )
|
||||
if( connectCreated[i].value == objectData.connect ) connectCreated[i].setAttribute('checked', 'checked');
|
||||
else connectCreated[i].removeAttribute('checked');
|
||||
|
||||
|
||||
|
||||
|
@ -441,7 +401,7 @@ inputPhoneFiche.prototype.sync = function(){
|
|||
for( var key in ficheData ){
|
||||
miniData = lsi.get('mini-fiches', ficheData[key].contact);
|
||||
|
||||
var ficheModifiedLast = ficheData[key].timestamp >= miniData.timestamp;
|
||||
var ficheModifiedLast = ficheData[key].timestamp > miniData.timestamp;
|
||||
|
||||
/* (3) Si la FICHE a été modifiée en dernier, on utilise ses données */
|
||||
if( ficheModifiedLast ){
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function inputPhoneMatrice(a){this.container=a}inputPhoneMatrice.prototype={container:this.container};
|
||||
inputPhoneMatrice.prototype.fieldsToStorage=function(){console.log("MATRICE: FIELDS TO STORAGE");var a=(new FormDeflater(this.container,["input"],["data-name"])).deflate();crc32(JSON.stringify(a));var d={},b;for(b in a)if(a[b]instanceof Array)for(var e in a[b])!0===a[b][e].status&&(null==d[b]&&(d[b]=[]),d[b].push(parseInt(a[b][e].value)));else!0===a[b].status&&(null==d[b]&&(d[b]=[]),d[b].push(parseInt(a[b].value)));lsi.set("matrice",0,d)};
|
||||
inputPhoneMatrice.prototype.storageToFields=function(){console.log("MATRICE: STORAGE TO FIELDS");var a=lsi["export"]("fiches"),d=lsi.get("matrice",0),b=lsi["export"]("contacts"),e=[],c;for(c in a)-1==e.indexOf(a[c].contact)&&e.push(a[c].contact);a="<table class='line'>";for(c=0;c<e.length;c++){var f=b[c],a=a+"<tr>";0<c?(a+='<td style="text-align: right;">',a+=f.firstname+" "+f.lastname,a+=0<f.username.length?" ("+f.username+")":"",a+="</td>"):a+="<td></td>";for(var h=0;h<e.length;h++)if(h<e.length-
|
||||
1){var g=b[h];0==c?(a+="<td>",a+='<span style="writing-mode: vertical-lr; text-align: right;">',a+=g.firstname+" "+g.lastname,a+=0<g.username.length?" ("+g.username+")":"",a+="</span>"):h<c?(a+="<td>",a+="<input type='checkbox' name='matrice_"+f.uid+"_"+g.uid+"' data-name='"+f.uid+"' value='"+g.uid+"' id='matrice_"+f.uid+"_"+g.uid+"'",null!=d[c]&&-1<d[c].indexOf(h)&&(a+=" checked"),a+=" >",a+="<label for='matrice_"+f.uid+"_"+g.uid+"'></label>"):a+="<td class='hidden'>";a+="</td>"}a+="</tr>"}this.container.innerHTML=
|
||||
inputPhoneMatrice.prototype.fieldsToStorage=function(){console.log("MATRICE: FIELDS TO STORAGE");var a=(new FormDeflater(this.container,["input"],["data-name"])).deflate();crc32(JSON.stringify(a));console.log(a);var d={},b;for(b in a)if(a[b]instanceof Array)for(var g in a[b])null==d[b]&&(d[b]=[]),d[b].push(parseInt(a[b][g]));else null!==a[b]&&(null==d[b]&&(d[b]=[]),d[b].push(parseInt(a[b])));lsi.set("matrice",0,d)};
|
||||
inputPhoneMatrice.prototype.storageToFields=function(){console.log("MATRICE: STORAGE TO FIELDS");var a=lsi["export"]("fiches"),d=lsi.get("matrice",0),b=lsi["export"]("contacts"),g=[],c;for(c in a)-1==g.indexOf(a[c].contact)&&g.push(a[c].contact);a="<table class='line'>";for(c=0;c<g.length;c++){var e=b[c],a=a+"<tr>";0<c?(a+='<td style="text-align: right;">',a+=e.firstname+" "+e.lastname,a+=0<e.username.length?" ("+e.username+")":"",a+="</td>"):a+="<td></td>";for(var h=0;h<g.length;h++)if(h<g.length-
|
||||
1){var f=b[h];0==c?(a+="<td>",a+='<span style="writing-mode: vertical-lr; text-align: right;">',a+=f.firstname+" "+f.lastname,a+=0<f.username.length?" ("+f.username+")":"",a+="</span>"):h<c?(a+="<td>",a+="<input type='checkbox' name='matrice_"+e.uid+"_"+f.uid+"' data-name='"+e.uid+"' value='"+f.uid+"' id='matrice_"+e.uid+"_"+f.uid+"'",null!=d[c]&&-1<d[c].indexOf(h)&&(a+=" checked"),a+=" >",a+="<label for='matrice_"+e.uid+"_"+f.uid+"'></label>"):a+="<td class='hidden'>";a+="</td>"}a+="</tr>"}this.container.innerHTML=
|
||||
a+"</table>"};inputPhoneMatrice.prototype.attach=function(){console.log("MATRICE: ATTACH");lsi.createDataset("matrice");this.storageToFields();var a=this;this.container.addEventListener("click",function(d){a.fieldsToStorage();a.storageToFields()},!1)};
|
||||
|
|
|
@ -26,7 +26,7 @@ inputPhoneMatrice.prototype.fieldsToStorage = function(){
|
|||
var deflatedHash = crc32(JSON.stringify(deflated));
|
||||
|
||||
|
||||
// console.log(deflated);
|
||||
console.log(deflated);
|
||||
|
||||
/* (3) On crée l'objet et on le remplit avec les relations */
|
||||
var obj = {};
|
||||
|
@ -37,21 +37,20 @@ inputPhoneMatrice.prototype.fieldsToStorage = function(){
|
|||
if( deflated[i] instanceof Array ){
|
||||
|
||||
// Pour chacune des différentes relations, on ajoute si TRUE
|
||||
for( var a in deflated[i] )
|
||||
if( deflated[i][a].status === true ){
|
||||
if( obj[i] == null )
|
||||
obj[i] = [];
|
||||
for( var a in deflated[i] ){
|
||||
if( obj[i] == null )
|
||||
obj[i] = [];
|
||||
|
||||
obj[i].push( parseInt(deflated[i][a].value) );
|
||||
}
|
||||
obj[i].push( parseInt(deflated[i][a]) );
|
||||
}
|
||||
|
||||
// {2} Si il n'y a qu'un sujet //
|
||||
}else if( deflated[i].status === true ){
|
||||
if( obj[i] == null )
|
||||
obj[i] = [];
|
||||
}else if( deflated[i] !== null ){
|
||||
if( obj[i] == null )
|
||||
obj[i] = [];
|
||||
|
||||
obj[i].push( parseInt(deflated[i].value) );
|
||||
}
|
||||
obj[i].push( parseInt(deflated[i]) );
|
||||
}
|
||||
|
||||
lsi.set( 'matrice', 0, obj );
|
||||
// Objet de la forme
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
function inputPhoneMini(a,b){this.container=a;this.nav_container=b}inputPhoneMini.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:[defTrue,defFalse],age:".",studies:".",loc:[defTrue,defFalse,defFalse,defFalse],reltype:[defTrue,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse,defFalse],reltypeSpecial:"",timestamp:0,valid:!1}};
|
||||
inputPhoneMini.prototype.fieldsToStorage=function(){console.log("MINI FICHE: FIELDS TO STORAGE");for(var a=$$("article.mini-relation-panel .mini-fiche-relation"),b=0;b<a.length;b++){var c=(new FormDeflater(a[b],["input","select"],["data-name"])).deflate(),e=crc32(JSON.stringify(c)),d=lsi.get("mini-fiches",c.uid.value);if(!1!==d){if(null!=d.hash&&d.hash==e)break;console.warn("> MINI UPDATE");c={uid:parseInt(c.uid.value),firstname:d.firstname,lastname:d.lastname,username:d.username,sexe:c.sexe,age:c.age.value,
|
||||
studies:c.studies.value,reltype:c.reltype,reltypeSpecial:c.reltypeSpecial.value,loc:c.loc,hash:e};c.valid=this.check(c);0<diff(d,c).length&&(console.warn("> FICHE UPDATE"),c.timestamp=Date.now());lsi.set("mini-fiches",c.uid,c)}}};
|
||||
function inputPhoneMini(a,b){this.container=a;this.nav_container=b}inputPhoneMini.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:"H",age:".",studies:".",loc:"0",reltype:"0",reltypeSpecial:"",timestamp:0,valid:!1}};
|
||||
inputPhoneMini.prototype.fieldsToStorage=function(){console.log("MINI FICHE: FIELDS TO STORAGE");for(var a=$$("article.mini-relation-panel .mini-fiche-relation"),b=0;b<a.length;b++){var c=(new FormDeflater(a[b],["input","select"],["data-name"])).deflate(),e=crc32(JSON.stringify(c)),d=lsi.get("mini-fiches",c.uid);if(!1!==d){if(null!=d.hash&&d.hash==e)break;console.warn("> MINI UPDATE");c={uid:parseInt(c.uid),firstname:d.firstname,lastname:d.lastname,username:d.username,sexe:c.sexe,age:c.age,studies:c.studies,
|
||||
reltype:c.reltype,reltypeSpecial:c.reltypeSpecial,loc:c.loc,hash:e};c.valid=this.check(c);0<diff(d,c,["hash","valid","timestamp"]).length&&(console.log(diff(d,c,["hash","valid","timestamp"])),console.warn("> FICHE UPDATE"),c.timestamp=Date.now());lsi.set("mini-fiches",c.uid,c)}}};
|
||||
inputPhoneMini.prototype.add=function(a){console.log("MINI FICHE: ADD");if(null==a||null==a.uid)return!1;a.age=null!=a.age?a.age:this.defaultData.age;a.sexe=null!=a.sexe?a.sexe:this.defaultData.sexe;a.studies=null!=a.studies?a.studies:this.defaultData.studies;a.reltype=null!=a.reltype?a.reltype:this.defaultData.reltype;a.reltypeSpecial=null!=a.reltypeSpecial?a.reltypeSpecial:this.defaultData.reltypeSpecial;a.loc=null!=a.loc?a.loc:this.defaultData.loc;var b=lsi.get("contacts",a.uid);if(!1===b)return!1;
|
||||
this.container.innerHTML+=miniFicheBuilder.build({firstname:b.firstname,lastname:b.lastname,username:0==b.username.length?"":"("+b.username+")",countcall:b.countcall,countsms:b.countsms,uid:a.uid,reltypespecial:a.reltypeSpecial});b=$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="studies"]>option[value="'+a.studies+'"]');null!=b&&b.setAttribute("selected","selected");b=$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="age"]>option[value="'+
|
||||
a.age+'"]');null!=b&&b.setAttribute("selected","selected");for(var c=$$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]'),b=0;b<c.length&&b<a.sexe.length;b++)a.sexe[b].status?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');for(b=0;b<c.length&&b<a.reltype.length;b++)a.reltype[b].status?c[b].setAttribute("checked",
|
||||
"checked"):c[b].removeAttribute("checked");c=$$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');for(b=0;b<c.length&&b<a.loc.length;b++)a.loc[b].status?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked")};inputPhoneMini.prototype.storageToFields=function(){console.log("MINI FICHE: STORAGE TO FIELDS");var a=lsi.get("mini-fiches",this.selected);this.container.innerHTML="";this.add(a);this.updateNavBar()};
|
||||
a.age+'"]');null!=b&&b.setAttribute("selected","selected");for(var c=$$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]'),b=0;b<c.length;b++)c[b].value==a.sexe?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');for(b=0;b<c.length;b++)c[b].value==a.reltype?c[b].setAttribute("checked","checked"):
|
||||
c[b].removeAttribute("checked");c=$$('article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');for(b=0;b<c.length;b++)c[b].value==a.loc?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked")};inputPhoneMini.prototype.storageToFields=function(){console.log("MINI FICHE: STORAGE TO FIELDS");var a=lsi.get("mini-fiches",this.selected);this.container.innerHTML="";this.add(a);this.updateNavBar()};
|
||||
inputPhoneMini.prototype.sync=function(){console.log("MINI FICHE: SYNC");var a=lsi["export"]("contacts"),b;for(b in a){var c=lsi.get("mini-fiches",b);null==c&&(c=this.defaultData,c.valid=!1);c.uid=a[b].uid;lsi.set("mini-fiches",b,c)}};inputPhoneMini.prototype.nav=function(a){if(null==a||!1===a.getData("n")||isNaN(a.getData("n"))||"nav-mini"!=a.parentNode.id)return!1;for(var b=$$("#nav-mini > span.active"),c=0;c<b.length;c++)b[c].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))};
|
||||
inputPhoneMini.prototype.updateNavBar=function(){var a=lsi["export"]("mini-fiches"),b=Object.keys(a).length;if($$("#nav-mini [data-n]").length!=b){this.nav_container.innerHTML="";for(var c=0;c<b;c++)this.nav_container.innerHTML+='<span data-n="'+c+'">'+(c+1)+"</span>"}for(var e in a)b=$('#nav-mini [data-n="'+a[e].uid+'"]'),null!=b&&(!0===a[e].valid?b.addClass("done"):b.remClass("done"));this.nav($('#nav-mini [data-n="'+this.selected+'"]'))};
|
||||
inputPhoneMini.prototype.check=function(a){return!checkRadioValue(a.sexe)||"."==a.studies||"."==a.age||!checkRadioValue(a.loc)||!checkRadioValue(a.reltype)||a.reltype[8].status&&2>a.reltypeSpecial.length?!1:!0};inputPhoneMini.prototype.attach=function(a){console.log("MINI FICHE: ATTACH");lsi.createDataset("mini-fiches");this.storageToFields();this.handler=a;var b=this;this.nav_container.addEventListener("click",function(a){b.nav(a.target);b.handler(a.target)},!1)};
|
||||
|
|
|
@ -13,15 +13,14 @@ inputPhoneMini.prototype = {
|
|||
selected: 0, // UID de la MINI fiche sélectionnée
|
||||
handler: null, // Fonction pour l'enregistrement et la synchronisation des données
|
||||
defaultData: { // Valeur par défaut
|
||||
sexe: [defTrue, defFalse],
|
||||
age: '.',
|
||||
studies: '.',
|
||||
loc: [defTrue, defFalse, defFalse, defFalse],
|
||||
reltype: [ defTrue, defFalse, defFalse, defFalse, defFalse,
|
||||
defFalse, defFalse, defFalse, defFalse], // Choix 1 à 9
|
||||
sexe: 'H',
|
||||
age: '.',
|
||||
studies: '.',
|
||||
loc: '0',
|
||||
reltype: '0',
|
||||
reltypeSpecial: '',
|
||||
timestamp: 0,
|
||||
valid: false
|
||||
timestamp: 0,
|
||||
valid: false
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -47,7 +46,7 @@ inputPhoneMini.prototype.fieldsToStorage = function(){
|
|||
|
||||
|
||||
// {4} On récupère les données du LSI si elles existent //
|
||||
var existingData = lsi.get('mini-fiches', deflated.uid.value);
|
||||
var existingData = lsi.get('mini-fiches', deflated.uid);
|
||||
|
||||
// Si n'existe pas, on passe à la suivante
|
||||
if( existingData === false )
|
||||
|
@ -63,15 +62,15 @@ inputPhoneMini.prototype.fieldsToStorage = function(){
|
|||
|
||||
|
||||
var obj = {
|
||||
uid: parseInt(deflated.uid.value),
|
||||
uid: parseInt(deflated.uid),
|
||||
firstname: existingData.firstname,
|
||||
lastname: existingData.lastname,
|
||||
username: existingData.username,
|
||||
sexe: deflated.sexe, // [0] Homme, [1] Femme
|
||||
age: deflated.age.value,
|
||||
studies: deflated.studies.value,
|
||||
age: deflated.age,
|
||||
studies: deflated.studies,
|
||||
reltype: deflated.reltype, // [0] ...
|
||||
reltypeSpecial: deflated.reltypeSpecial.value,
|
||||
reltypeSpecial: deflated.reltypeSpecial,
|
||||
loc: deflated.loc, // [0] Choix 1 -> [3] Choix 4
|
||||
hash: deflatedHash
|
||||
};
|
||||
|
@ -80,7 +79,8 @@ inputPhoneMini.prototype.fieldsToStorage = function(){
|
|||
obj.valid = this.check(obj);
|
||||
|
||||
// On met à jour la date de modification, si on a pas qu'@uid de différent
|
||||
if( diff(existingData, obj).length > 0 ){
|
||||
if( diff(existingData, obj, ['hash', 'valid', 'timestamp']).length > 0 ){
|
||||
console.log( diff(existingData, obj, ['hash', 'valid', 'timestamp']) );
|
||||
console.warn('> FICHE UPDATE');
|
||||
obj.timestamp = Date.now();
|
||||
}
|
||||
|
@ -155,21 +155,21 @@ inputPhoneMini.prototype.add = function(objectData){
|
|||
|
||||
/* {5} On sélectionna la valeur des boutons <radio> pour le SEXE */
|
||||
var sexeCreated = $$('article.mini-fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]');
|
||||
for( var i = 0 ; i < sexeCreated.length && i < objectData.sexe.length ; i++ )
|
||||
if( objectData.sexe[i].status ) sexeCreated[i].setAttribute('checked', 'checked');
|
||||
else sexeCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < sexeCreated.length ; i++ )
|
||||
if( sexeCreated[i].value == objectData.sexe ) sexeCreated[i].setAttribute('checked', 'checked');
|
||||
else sexeCreated[i].removeAttribute('checked');
|
||||
|
||||
/* {6} On sélectionna la valeur des boutons <radio> pour le TYPE DE RELATION */
|
||||
var reltypeCreated = $$('article.mini-fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');
|
||||
for( var i = 0 ; i < reltypeCreated.length && i < objectData.reltype.length ; i++ )
|
||||
if( objectData.reltype[i].status ) reltypeCreated[i].setAttribute('checked', 'checked');
|
||||
else reltypeCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < reltypeCreated.length ; i++ )
|
||||
if( reltypeCreated[i].value == objectData.reltype ) reltypeCreated[i].setAttribute('checked', 'checked');
|
||||
else reltypeCreated[i].removeAttribute('checked');
|
||||
|
||||
/* {7} On sélectionna la valeur des boutons <radio> pour la LOCATION */
|
||||
var locCreated = $$('article.mini-fiche-relation input[data-name="uid"][value="'+objectData.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');
|
||||
for( var i = 0 ; i < locCreated.length && i < objectData.loc.length ; i++ )
|
||||
if( objectData.loc[i].status ) locCreated[i].setAttribute('checked', 'checked');
|
||||
else locCreated[i].removeAttribute('checked');
|
||||
for( var i = 0 ; i < locCreated.length ; i++ )
|
||||
if( locCreated[i].value == objectData.loc ) locCreated[i].setAttribute('checked', 'checked');
|
||||
else locCreated[i].removeAttribute('checked');
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function FormDeflater(b,c,a){for(var d=0;d<c.length;d++)c[d]=c[d].toLowerCase();for(d=0;d<a.length;d++)a[d]=a[d].toLowerCase();this.container=b;this.tags=c;this.attr=a}FormDeflater.prototype={container:this.container,tags:this.tags,attr:this.attr};
|
||||
FormDeflater.prototype.deflate=function(){for(var b=this.getChildren(this.container),b=this.filterElements(b),c={},a=0;a<b.length;a++)for(var d=0;d<this.attr.length;d++){var e=b[a].getAttribute(this.attr[d]);if(null!==e&&0<e.length){c.hasOwnProperty(e)?c[e]instanceof Array?c[e].push({target:b[a],attr:this.attr[d],value:b[a].value,checked:b[a].checked}):c[e]=[c[e],{target:b[a],attr:this.attr[d],value:b[a].value,checked:b[a].checked}]:c[e]={target:b[a],attr:this.attr[d],value:b[a].value,checked:b[a].checked};
|
||||
break}}return c=this.cleanOutput(c)};FormDeflater.prototype.checkable=function(b){return"INPUT"!=b.tagName||-1==["radio","checkbox"].indexOf(b.getAttribute("type").toLowerCase())?!1:!0};
|
||||
FormDeflater.prototype.cleanOutput=function(b){var c={},a;for(a in b)if(b[a]instanceof Array){var d=!0,e=[],f;for(f in b[a])if(this.checkable(b[a][f].target))!0===b[a][f].checked&&e.push(f);else{d=!1;break}if(d)if(1==e.length)c[a]=b[a][e[0]].value;else for(f in c[a]=[],e)c[a].push(b[a][e[f]].value);else for(f in c[a]=[],b[a])c[a].push(b[a][f].value)}else this.checkable(b[a].target)?c[a]=b[a].checked:c[a]=b[a].value;return c};
|
||||
FormDeflater.prototype.cleanOutput=function(b){var c={},a;for(a in b)if(b[a]instanceof Array){var d=!0,e=[],f;for(f in b[a])if(this.checkable(b[a][f].target))!0===b[a][f].checked&&e.push(f);else{d=!1;break}if(d)if(1==e.length)c[a]=b[a][e[0]].value;else for(f in c[a]=[],e)c[a].push(b[a][e[f]].value);else for(f in c[a]=[],b[a])c[a].push(b[a][f].value)}else this.checkable(b[a].target)?c[a]=b[a].checked?b[a].value:null:c[a]=b[a].value;return c};
|
||||
FormDeflater.prototype.getChildren=function(b){if(!(b instanceof Element))return[];for(var c=b=[].slice.call(b.children),a=0;a<b.length;a++)c=c.concat([].slice.call(this.getChildren(b[a])));return c};FormDeflater.prototype.filterElements=function(b){for(var c=[],a=0;a<b.length;a++)-1<this.tags.indexOf(b[a].tagName.toLowerCase())&&c.push(b[a]);return c};
|
||||
|
|
|
@ -189,7 +189,7 @@ FormDeflater.prototype.cleanOutput = function(input){
|
|||
|
||||
/* (1) Si de type 'radio' ou 'checkbox', on met la valeur de 'checked' */
|
||||
if( this.checkable(input[key].target) )
|
||||
output[key] = input[key].checked;
|
||||
output[key] = input[key].checked ? input[key].value : null;
|
||||
|
||||
/* (2) Sinon, on met la valeur de 'value' */
|
||||
else
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function $(a){return document.querySelector(a)}function $$(a){return document.querySelectorAll(a)}Element.prototype.getData=function(a){return"undefined"==typeof this.dataset?!1:this.dataset.hasOwnProperty(a)?this.dataset[a]:!1};Element.prototype.addClass=function(a){var b=this.className.split(" ");-1<b.indexOf(a)||(b.push(a),this.className=b.join(" ").trim())};
|
||||
Element.prototype.remClass=function(a){var b=this.className.split(" ");a=b.indexOf(a);-1!=a&&(b=b.slice(0,a).concat(b.slice(a+1)),this.className=b.join(" ").trim())};NodeList.prototype.indexOf=HTMLCollection.prototype.indexOf=function(a){for(var b=0;b<this.length;b++)if(this[b]==a)return b;return-1};Element.prototype.anim=function(a,b){var c=this;c.addClass(a);setTimeout(function(){c.remClass(a)},b)};var _includes=[],_includeTags=[];
|
||||
function include(a,b,c){a="string"===typeof a?a:null;b="function"===typeof b?b:function(){console.log("[x] "+a+" loaded")};if(null==a)return!1;if("boolean"===typeof c&&c){b=_includes.indexOf(a);if(-1==b)return!1;document.head.removeChild(_includeTags[b]);_includes.splice(b,1);_includeTags.splice(b,1)}else{if(-1<_includes.indexOf(a))return b(),!0;c=document.createElement("script");c.type="text/javascript";c.src=a;document.head.appendChild(c);_includes.push(a);_includeTags.push(c);c.onload=b}return!0}
|
||||
function diff(a,b){var c=[],d;for(d in a)null!=b[d]&&null!=a[d]&&(typeof a[d]!==typeof b[d]?c.push(d):a[d]instanceof Object&&b[d]instanceof Object?0<diff(a[d],b[d]).length&&c.push(d):a[d]!=b[d]&&c.push(d));return c}var format_number=new formatChecker(null,"0i ii ii ii ii");
|
||||
Element.prototype.remClass=function(a){var b=this.className.split(" ");a=b.indexOf(a);-1!=a&&(b=b.slice(0,a).concat(b.slice(a+1)),this.className=b.join(" ").trim())};NodeList.prototype.indexOf=HTMLCollection.prototype.indexOf=function(a){for(var b=0;b<this.length;b++)if(this[b]==a)return b;return-1};Element.prototype.anim=function(a,b){var d=this;d.addClass(a);setTimeout(function(){d.remClass(a)},b)};var _includes=[],_includeTags=[];
|
||||
function include(a,b,d){a="string"===typeof a?a:null;b="function"===typeof b?b:function(){console.log("[x] "+a+" loaded")};if(null==a)return!1;if("boolean"===typeof d&&d){b=_includes.indexOf(a);if(-1==b)return!1;document.head.removeChild(_includeTags[b]);_includes.splice(b,1);_includeTags.splice(b,1)}else{if(-1<_includes.indexOf(a))return b(),!0;d=document.createElement("script");d.type="text/javascript";d.src=a;document.head.appendChild(d);_includes.push(a);_includeTags.push(d);d.onload=b}return!0}
|
||||
function diff(a,b,d){var e=[],c;for(c in a)null==b[c]||null==a[c]||d instanceof Array&&-1<d.indexOf(c)||(typeof a[c]!==typeof b[c]?e.push(c):a[c]instanceof Object&&b[c]instanceof Object?0<diff(a[c],b[c]).length&&e.push(c):a[c]!=b[c]&&e.push(c));return e}var format_number=new formatChecker(null,"0i ii ii ii ii");
|
||||
|
|
|
@ -152,16 +152,17 @@ function include(jsResource, callback, action){ // action=true -> EXCLUSION, SIN
|
|||
*
|
||||
* @A<Object> Premier Objet
|
||||
* @B<Object> Second Objet
|
||||
* @ignore<Array> Tableau des clés à ignorer
|
||||
*
|
||||
* @return diff<Array> Tableau contenant les clés des valeurs différentes (uniquement les clés communes et non NULLes)
|
||||
*
|
||||
*/
|
||||
function diff(A, B){
|
||||
function diff(A, B, ignore){
|
||||
var dKeys = [];
|
||||
|
||||
for( var key in A ){
|
||||
// Si A[key] ou B[key] est NULL, on ne compare pas
|
||||
if( B[key] == null || A[key] == null )
|
||||
if( B[key] == null || A[key] == null || ignore instanceof Array && ignore.indexOf(key) > -1 )
|
||||
continue;
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var subjectManager,contactManager,miniManager,ficheManager,matriceManager,defTrue={status:!0,value:"on"},defFalse={status:!1,value:"on"};
|
||||
var subjectManager,contactManager,miniManager,ficheManager,matriceManager;
|
||||
function dynamicUpdate(a){var f=a instanceof Element,b=f&&"SPAN"==a.tagName&&"switch-left"==a.className,e=f&&"SPAN"==a.tagName&&"switch-both"==a.className,c=f&&"INPUT"==a.tagName&&"submit"==a.type,d=f&&"SPAN"==a.tagName&&("nav-mini"==a.parentNode.id||"nav-fiche"==a.parentNode.id),f=f&&"SPAN"==a.tagName&&"nav-contact"==a.parentNode.id;if(!(e||b||c||d||f)&&!0!==a)return!1;if(e)console.log("> switch firstname <-> lastname"),b=a.parentNode,a=b.children[8],b=b.children[10],e=a.value,a.value=b.value,b.value=
|
||||
e;else if(b){console.log("> switch firstname+lastname -> username");b=a.parentNode;e=b.children[6];a=b.children[8];b=b.children[10];if(0<e.value.length||0==a.value.length&&0==b.value.length)return!1;e.value=a.value+" "+b.value;a.value="";b.value=""}else console.log("> dynamic update"),miniManager.fieldsToStorage(),ficheManager.fieldsToStorage(),contactManager.fieldsToStorage(),matriceManager.fieldsToStorage(),miniManager.sync(),ficheManager.sync(),miniManager.storageToFields(),ficheManager.storageToFields(),
|
||||
matriceManager.storageToFields(),(c||f)&&contactManager.storageToFields()}function checkRadioValue(a){for(var f=0,b=0;b<a.length;b++)!0===a[b].status&&f++;return 1!=f?!1:!0}
|
||||
|
|
|
@ -15,10 +15,6 @@ var miniManager;
|
|||
var ficheManager;
|
||||
var matriceManager;
|
||||
|
||||
// CONSTANTES
|
||||
var defTrue = {status: true, value: 'on'};
|
||||
var defFalse = {status: false, value: 'on'};
|
||||
|
||||
|
||||
/* (2) Fonctions utiles */
|
||||
function dynamicUpdate(target){
|
||||
|
|
Loading…
Reference in New Issue