`input.js::testRoutinePhone` gestion des anciens+nouveau éléments
This commit is contained in:
parent
164f3cd4ef
commit
aebde78785
|
@ -12,7 +12,7 @@
|
|||
|
||||
"contacts": {
|
||||
|
||||
"sexe": { "0":"Homme", "1":"Femme", "2":"Indéterminé" },
|
||||
"sexe": { "0":"Homme", "1":"Femme", "2":"Indéterminé" }, .
|
||||
"age": {
|
||||
".": "NA",
|
||||
"0": "5 à 10", "1": "10 à 15", "2": "15 à 20", "3": "20 à 25", "4": "25 à 30",
|
||||
|
|
|
@ -472,10 +472,10 @@ pFicheBuilder.setLayout(
|
|||
|
||||
"\t<h4 data-icon='g'>Comment cette personne utilise-t-elle les médias sociaux de votre point de vue ? Il s'agit :</h4>\n"+
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsoc0_p_@uid' value='0'><label for='medsoc0_p_@uid'>D'une personne qui n'utilise pas ou peu les médias sociaux</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsoc1_p_@uid' value='1'><label for='medsoc1_p_@uid'>D'une personne qui consulte des publications mais partage peu de contenus</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsoc2_p_@uid' value='2'><label for='medsoc2_p_@uid'>D'une personne qui consulte des publication et partage des contenus de temps en temps</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsoc3_p_@uid' value='3'><label for='medsoc3_p_@uid'>D'une personne qui partage beaucoup de contenus et s'exprime fréquemment</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsocA_p_@uid' value='0'><label for='medsocA_p_@uid'>D'une personne qui n'utilise pas ou peu les médias sociaux</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsocB_p_@uid' value='1'><label for='medsocB_p_@uid'>D'une personne qui consulte des publications mais partage peu de contenus</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsocC_p_@uid' value='2'><label for='medsocC_p_@uid'>D'une personne qui consulte des publication et partage des contenus de temps en temps</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medsoc_p_@uid' data-name='medsoc' id='medsocD_p_@uid' value='3'><label for='medsocD_p_@uid'>D'une personne qui partage beaucoup de contenus et s'exprime fréquemment</label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"\t<h5 class='nobold color0'>Sur une échelle de 1 à 5, préciser l'intérêt que vous accordez aux contenue qu'elle partage via les médias sociaux<br><br>\n"+
|
||||
|
@ -553,9 +553,9 @@ pFicheBuilder.setLayout(
|
|||
|
||||
"\t<h5 class='nobold color0'>Considérez-vous que vos échange avec cette personne à travers les médias sociaux: </h5>\n"+
|
||||
"\t<h5 class='nobold color0'>\n"+
|
||||
"\t\t <input type='radio' name='medrel_p_@uid' data-name='medrel' id='medrel0_p_@uid' value='0'><label for='medrel0_p_@uid'>N'ont aucun effet sur votre relation</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medrel_p_@uid' data-name='medrel' id='medrel1_p_@uid' value='1'><label for='medrel1_p_@uid'>Vous ont rapproché d'elle</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medrel_p_@uid' data-name='medrel' id='medrel2_p_@uid' value='2'><label for='medrel2_p_@uid'>Vous ont éloigné d'elle</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medrel_p_@uid' data-name='medrel' id='medrelA_p_@uid' value='0'><label for='medrelA_p_@uid'>N'ont aucun effet sur votre relation</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medrel_p_@uid' data-name='medrel' id='medrelB_p_@uid' value='1'><label for='medrelB_p_@uid'>Vous ont rapproché d'elle</label><br>\n"+
|
||||
"\t\t <input type='radio' name='medrel_p_@uid' data-name='medrel' id='medrelC_p_@uid' value='2'><label for='medrelC_p_@uid'>Vous ont éloigné d'elle</label><br>\n"+
|
||||
"\t</h5>\n"+
|
||||
|
||||
"</article>\n");
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -940,10 +940,10 @@ function testRoutinePhone(doMini){
|
|||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="studies"]').value = stuVal;
|
||||
|
||||
// {5} Type de relation //
|
||||
var relVal = count % 9;
|
||||
var relVal = count % 8;
|
||||
|
||||
// Si AUTRE
|
||||
if( relVal == 8 ){
|
||||
if( relVal == 7 ){
|
||||
$('#reltype10_p_'+f).checked = true;
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="reltypeSpecial"]').value = 'autre';
|
||||
// Sinon
|
||||
|
@ -959,6 +959,22 @@ function testRoutinePhone(doMini){
|
|||
var locVal = ['A', 'B', 'C', 'D'][ Math.floor(count % 4) ];
|
||||
$('#loc'+locVal+'_p_'+f).checked = true;
|
||||
|
||||
// {7} Situation familiale //
|
||||
var famsitVal = ['A', 'B', 'C', 'D'][ Math.floor(count % 4) ];
|
||||
$('#famsit'+famsitVal+'_p_'+f).checked = true;
|
||||
|
||||
// {7} Situation familiale //
|
||||
var famsitVal = ['A', 'B', 'C', 'D'][ Math.floor(count % 4) ];
|
||||
$('#famsit'+famsitVal+'_p_'+f).checked = true;
|
||||
|
||||
// {7} Utilisation des Medias Sociaux //
|
||||
var medsocVal = ['A', 'B', 'C', 'D'][ Math.floor(count % 4) ];
|
||||
$('#medsoc'+medsocVal+'_p_'+f).checked = true;
|
||||
|
||||
// {7} Relation via médias sociaux //
|
||||
var medrelVal = ['A', 'B', 'C'][ Math.floor(count % 3) ];
|
||||
$('#medrel'+medrelVal+'_p_'+f).checked = true;
|
||||
|
||||
// {8} Temps de connaissance //
|
||||
var duration = $$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="duration"]');
|
||||
duration[0].value = count.toString();
|
||||
|
@ -982,7 +998,41 @@ function testRoutinePhone(doMini){
|
|||
if( ctxVal == 13 )
|
||||
ctxSpe[2].value = 'autre';
|
||||
|
||||
// {3} On remplit les interets //
|
||||
var interestVal = ['0','1','2','3','4'];
|
||||
interestVal = interestVal[ count % interestVal.length ];
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="interest"]').value = interestVal;
|
||||
|
||||
// {3} On remplit la relation avec la personne //
|
||||
var relmarkVal = ['0','1','2','3','4'];
|
||||
relmarkVal = relmarkVal[ count % relmarkVal.length ];
|
||||
$('article.fiche-relation > input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="relmark"]').value = relmarkVal;
|
||||
|
||||
|
||||
// FREQ
|
||||
var freqVal;
|
||||
for( var i = 0 ; i < 5 ; i++ ){
|
||||
freqVal = 1+ i*5+ Math.floor( count % 4 );
|
||||
if( freqVal < 10 ) freqVal = '0'+freqVal;
|
||||
|
||||
$('#freq'+freqVal+'_p_'+f).checked = true;
|
||||
}
|
||||
// IRLFREQ
|
||||
var irlfreqVal;
|
||||
for( var i = 0 ; i < 5 ; i++ ){
|
||||
irlfreqVal = 1+ i*5+ Math.floor( count % 4 );
|
||||
if( irlfreqVal < 10 ) irlfreqVal = '0'+irlfreqVal;
|
||||
|
||||
$('#irlfreq'+irlfreqVal+'_p_'+f).checked = true;
|
||||
}
|
||||
|
||||
// CONNECT
|
||||
var connectVal;
|
||||
for( var i = 1 ; i < 7 ; i++ ){
|
||||
connectVal = 1+ Math.floor( count % 2 );
|
||||
|
||||
$('#connect'+i+''+connectVal+'_p_'+f).checked = true;
|
||||
}
|
||||
|
||||
count++;
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
var sField,sSubmit,sList,pSubjectManager=null,pContactManager=null,pMiniManager=null,pFicheManager=null,pMatriceManager=null,fSubjectManager=null,fContactManager=null,fMiniManager=null,fFicheManager=null,fMatriceManager=null,input_ts=Date.now();sField=$("#search-field");sSubmit=$("#search-subject");sList=$('section[data-sublink="survey"] ul[data-list]');
|
||||
var tmpSubjectSearchListener=function(a){api.send({path:"subject/search",name:sField.value},function(a){console.warn(a);if(0!=a.ModuleError)return Notification.error("Erreur","La recherche a \u00e9chou\u00e9."),!1;console.log(a);var c=[],g;for(g in a.results)c.push("<li data-element data-id='"+g+"'>"),c.push("<div data-user><span>SUJET</span></div>"),c.push("<div> <span><input type='text' readonly style='text-align: center' onclick='this.select()' class='flag' value='"+g+"'></span> </div>"),c.push("<div> <span data-prefix='Nom'>"+
|
||||
a.results[g].name+"</span> </div>"),c.push("<div> <span data-prefix='Cr\u00e9ation'>"+a.results[g].creation+"</span> </div>"),c.push("<div> <span><input type='checkbox' id='s_"+g+"' "+(null!=a.results[g].phone?"checked":"")+" disabled><label for='s_"+g+"'>Cellulaire</label>"),c.push("</span> </div>"),c.push("<div> <span><input type='checkbox' id='s_"+g+"' "+(null!=a.results[g].facebook?"checked":"")+" disabled><label for='s_"+g+"'>Facebook</label>"),c.push("</span> </div>"),c.push("</li>");sList.innerHTML=
|
||||
c.join("")})};sSubmit.addEventListener("click",tmpSubjectSearchListener,!1);sField.addEventListener("keypress",function(a){13===a.keyCode&&tmpSubjectSearchListener(a)},!1);tmpSubjectSearchListener();
|
||||
var tmpSubjectSearchListener=function(a){api.send({path:"subject/search",name:sField.value},function(b){console.warn(b);if(0!=b.ModuleError)return Notification.error("Erreur","La recherche a \u00e9chou\u00e9."),!1;console.log(b);var a=[],e;for(e in b.results)a.push("<li data-element data-id='"+e+"'>"),a.push("<div data-user><span>SUJET</span></div>"),a.push("<div> <span><input type='text' readonly style='text-align: center' onclick='this.select()' class='flag' value='"+e+"'></span> </div>"),a.push("<div> <span data-prefix='Nom'>"+
|
||||
b.results[e].name+"</span> </div>"),a.push("<div> <span data-prefix='Cr\u00e9ation'>"+b.results[e].creation+"</span> </div>"),a.push("<div> <span><input type='checkbox' id='s_"+e+"' "+(null!=b.results[e].phone?"checked":"")+" disabled><label for='s_"+e+"'>Cellulaire</label>"),a.push("</span> </div>"),a.push("<div> <span><input type='checkbox' id='s_"+e+"' "+(null!=b.results[e].facebook?"checked":"")+" disabled><label for='s_"+e+"'>Facebook</label>"),a.push("</span> </div>"),a.push("</li>");sList.innerHTML=
|
||||
a.join("")})};sSubmit.addEventListener("click",tmpSubjectSearchListener,!1);sField.addEventListener("keypress",function(a){13===a.keyCode&&tmpSubjectSearchListener(a)},!1);tmpSubjectSearchListener();
|
||||
var pAlready=0,pLoaded=[0,0,0,0,0],phoneRoutine=function(){!Math.min.apply(Math,pLoaded)|pAlready||(pAlready=1,console.groupEnd(),console.group("[phone] Initialization"),pSubjectManager=new inputPhoneSubject($('[data-sublink="phone"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="phone"] article.subject-panel [data-name="submit"]')),pSubjectManager.attach(pDynamicUpdate),pContactManager=new inputPhoneContact($('[data-sublink="phone"] article.contact-panel'),$('[data-sublink="phone"] #p_nav-contact')),
|
||||
pContactManager.attach(pDynamicUpdate),pMiniManager=new inputPhoneMini($('[data-sublink="phone"] article.mini-relation-panel'),$('[data-sublink="phone"] #p_nav-mini')),pMiniManager.attach(pDynamicUpdate),pFicheManager=new inputPhoneFiche($('[data-sublink="phone"] article.relation-panel'),$('[data-sublink="phone"] #p_nav-fiche')),pFicheManager.top_size=20,pFicheManager.attach(pDynamicUpdate),pMatriceManager=new inputPhoneMatrice($('[data-sublink="phone"] article.matrice-panel')),pMatriceManager.attach(pDynamicUpdate),
|
||||
$('[data-sublink="phone"] #p_clear-all').addEventListener("click",function(a){lsi.clear("p_subject");lsi.clear("p_contacts");lsi.clear("p_mini-fiches");lsi.clear("p_fiches");lsi.clear("p_matrice");lsi.clear("p_friends");pSubjectManager.storageToFields();pContactManager.storageToFields();pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();Notification.success("OK","Les donn\u00e9es ont \u00e9t\u00e9 supprim\u00e9es")},!1),$('[data-sublink="phone"] #p_export-all').addEventListener("click",
|
||||
function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("p_subject")[0],contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};var b=$('[data-sublink="phone"] #p_download-target');b.download="local-facebook-data.json";b.href="data:application/octet-stream,"+encodeURIComponent(JSON.stringify(a));b.click()},!1),$('[data-sublink="phone"] #p_import-all').addEventListener("click",
|
||||
function(a){$('[data-sublink="phone"] #p_local-upload').click()},!1),$('[data-sublink="phone"] #p_local-upload').addEventListener("click",function(a){a.target.value=null},!1),$('[data-sublink="phone"] #p_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="phone"] #p_local-upload').files[0]};api.send(a,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("Erreur",a.ModuleError),!1;lsi.set("p_subject",0,a.local_data.subject);lsi["import"]("p_contacts",
|
||||
a.local_data.contacts);lsi["import"]("p_mini-fiches",a.local_data.mini);lsi["import"]("p_fiches",a.local_data.fiches);lsi.set("p_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1),$('[data-sublink="phone"] #p_submit-all').addEventListener("click",function(a){console.log("> GATHERING ALL DATA");pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();
|
||||
if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("p_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("p_fiches");for(c in a)if(!a[c].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),
|
||||
!1;c={path:"input/phone",subject:lsi["export"]("p_subject")[0].subject_id,contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd())};
|
||||
if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("p_mini-fiches");var b=0,f;for(f in a)if(!isNaN(f)&&(b++,!a[f].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("p_fiches");for(f in a)if(!a[f].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(f)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),
|
||||
!1;f={path:"input/phone",subject:lsi["export"]("p_subject")[0].subject_id,contacts:lsi["export"]("p_contacts"),mini:lsi["export"]("p_mini-fiches"),fiches:lsi["export"]("p_fiches"),matrice:lsi["export"]("p_matrice")[0]};api.send(f,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK","L'identifiant du sujet est <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd())};
|
||||
include("/js/includes/input-phone-subject.js",function(){pLoaded[0]=1;phoneRoutine()});include("/js/includes/input-phone-contact.js",function(){pLoaded[1]=1;phoneRoutine()});include("/js/includes/input-phone-mini.js",function(){pLoaded[2]=1;phoneRoutine()});include("/js/includes/input-phone-fiche.js",function(){pLoaded[3]=1;phoneRoutine()});include("/js/includes/input-phone-matrice.js",function(){pLoaded[4]=1;phoneRoutine()});
|
||||
var fAlready=0,fLoaded=[0,0,0,0,0],facebookRoutine=function(){!Math.min.apply(Math,fLoaded)|fAlready||(fAlready=1,console.groupEnd(),console.group("[facebook] Initialization"),fSubjectManager=new inputFacebookSubject($('[data-sublink="facebook"] article.subject-panel [data-name="subject_id"]'),$('[data-sublink="facebook"] article.subject-panel [data-name="submit"]')),fSubjectManager.attach(fDynamicUpdate),fContactManager=new inputFacebookContact($('[data-sublink="facebook"] article.contact-panel'),
|
||||
$('[data-sublink="facebook"] #f_nav-contact')),fContactManager.attach(fDynamicUpdate),fMiniManager=new inputFacebookMini($('[data-sublink="facebook"] article.mini-relation-panel'),$('[data-sublink="facebook"] #f_nav-mini')),fMiniManager.attach(fDynamicUpdate),fFicheManager=new inputFacebookFiche($('[data-sublink="facebook"] article.relation-panel'),$('[data-sublink="facebook"] #f_nav-fiche')),fFicheManager.top_size=20,fFicheManager.attach(fDynamicUpdate),fMatriceManager=new inputFacebookMatrice($('[data-sublink="facebook"] article.matrice-panel')),
|
||||
|
@ -17,24 +17,25 @@ fMatriceManager.attach(fDynamicUpdate),$('[data-sublink="facebook"] #f_clear-all
|
|||
!1),$('[data-sublink="facebook"] #f_export-all').addEventListener("click",function(a){Notification.info("INFORMATION","Lancement du t\u00e9l\u00e9chargement de la sauvegarde");a={subject:lsi["export"]("f_subject")[0].subject_id,contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};var b=$('[data-sublink="facebook"] #f_download-target');b.download="local-facebook-data.json";b.href="data:application/octet-stream,"+
|
||||
encodeURIComponent(JSON.stringify(a));b.click()},!1),$('[data-sublink="facebook"] #f_import-all').addEventListener("click",function(a){$('[data-sublink="facebook"] #f_local-upload').click()},!1),$('[data-sublink="facebook"] #f_local-upload').addEventListener("click",function(a){a.target.value=null},!1),$('[data-sublink="facebook"] #f_local-upload').addEventListener("change",function(a){a={path:"upload/local_data",file:$('[data-sublink="facebook"] #f_local-upload').files[0]};api.send(a,function(a){console.log(a);
|
||||
if(0!=a.ModuleError)return Notification.error("Erreur",a.ModuleError),!1;lsi.set("f_subject",0,a.local_data.subject);lsi["import"]("f_contacts",a.local_data.contacts);lsi["import"]("f_mini-fiches",a.local_data.mini);lsi["import"]("f_fiches",a.local_data.fiches);lsi.set("f_matrice",0,a.local_data.matrice);pSubjectManager.storageToFields();pContactManager.storageToFields();pMatriceManager.storageToFields();pDynamicUpdate(!0)})},!1),$('[data-sublink="facebook"] #f_submit-all').addEventListener("click",
|
||||
function(a){console.log("> GATHERING ALL DATA");pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("f_mini-fiches");var b=0,c;for(c in a)if(!isNaN(c)&&(b++,!a[c].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("f_fiches");
|
||||
for(c in a)if(!a[c].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(c)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;c={path:"input/facebook",subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};api.send(c,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK",
|
||||
function(a){console.log("> GATHERING ALL DATA");pContactManager.fieldsToStorage();pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();if(!pSubjectManager.check())return Notification.warning("Attention","Vous devez saisir les informations du <i>sujet</i>"),!1;a=lsi["export"]("f_mini-fiches");var b=0,f;for(f in a)if(!isNaN(f)&&(b++,!a[f].valid))return Notification.warning("Attention","La <i>fiche rapide</i> <b>"+b+"</b> est incompl\u00e8te et/ou incorrecte"),!1;a=lsi["export"]("f_fiches");
|
||||
for(f in a)if(!a[f].valid)return Notification.warning("Attention","La <i>fiche compl\u00e8te</i> <b>"+(parseInt(f)+1)+"</b> est incompl\u00e8te et/ou incorrecte"),!1;f={path:"input/facebook",subject:lsi["export"]("f_subject")[0],contacts:lsi["export"]("f_contacts"),mini:lsi["export"]("f_mini-fiches"),fiches:lsi["export"]("f_fiches"),matrice:lsi["export"]("f_matrice")[0]};api.send(f,function(a){console.log(a);if(0!=a.ModuleError)return Notification.error("ERREUR",a.ModuleError),!1;Notification.success("OK",
|
||||
"L'identifiant du sujet est <strong>"+a.subject_id+"</strong> ! Tout s'est bien d\u00e9roul\u00e9.",1E4);console.log(a)},!1)},!1),console.groupEnd())};include("/js/includes/input-facebook-subject.js",function(){fLoaded[0]=1;facebookRoutine()});include("/js/includes/input-facebook-contact.js",function(){fLoaded[1]=1;facebookRoutine()});include("/js/includes/input-facebook-mini.js",function(){fLoaded[2]=1;facebookRoutine()});include("/js/includes/input-facebook-fiche.js",function(){fLoaded[3]=1;facebookRoutine()});
|
||||
include("/js/includes/input-facebook-matrice.js",function(){fLoaded[4]=1;facebookRoutine()});
|
||||
var pDynamicUpdate=function(a){var b=a instanceof Element,c=b&&"INPUT"==a.tagName&&"submit"==a.type,g=b&&"SPAN"==a.tagName&&("p_nav-mini"==a.parentNode.id||"p_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"p_nav-contact"==a.parentNode.id;if(!c&&!g&&!b&&!0!==a)return!1;console.groupEnd();console.groupEnd();console.group("[phone] Dynamic Update");pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();pContactManager.fieldsToStorage();pMatriceManager.fieldsToStorage();pFicheManager.sync();
|
||||
var pDynamicUpdate=function(a){var b=a instanceof Element,f=b&&"INPUT"==a.tagName&&"submit"==a.type,e=b&&"SPAN"==a.tagName&&("p_nav-mini"==a.parentNode.id||"p_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"p_nav-contact"==a.parentNode.id;if(!f&&!e&&!b&&!0!==a)return!1;console.groupEnd();console.groupEnd();console.group("[phone] Dynamic Update");pMiniManager.fieldsToStorage();pFicheManager.fieldsToStorage();pContactManager.fieldsToStorage();pMatriceManager.fieldsToStorage();pFicheManager.sync();
|
||||
pMiniManager.sync();!0===a?api.send({path:"subject/getFriends",subject_id:pSubjectManager.subject_id.value},function(a){console.warn("xx",a);if(0!=a.ModuleError)return console.groupEnd(),!1;lsi["import"]("p_friends",a.subjects);pMiniManager.storageToFields();pFicheManager.storageToFields();pMatriceManager.storageToFields();pContactManager.storageToFields();pMiniManager.updateNavBar();pFicheManager.updateNavBar()}):(pMiniManager.storageToFields(),pFicheManager.storageToFields(),pMatriceManager.storageToFields(),
|
||||
pMiniManager.updateNavBar(),pFicheManager.updateNavBar(),(c||b)&&pContactManager.storageToFields());console.groupEnd()},fDynamicUpdate=function(a){var b=a instanceof Element,c=b&&"INPUT"==a.tagName&&"submit"==a.type,g=b&&"SPAN"==a.tagName&&("f_nav-mini"==a.parentNode.id||"f_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"f_nav-contact"==a.parentNode.id;if(!c&&!g&&!b&&!0!==a)return!1;console.groupEnd();console.groupEnd();console.group("[facebook] Dynamic Update");fMiniManager.fieldsToStorage();
|
||||
pMiniManager.updateNavBar(),pFicheManager.updateNavBar(),(f||b)&&pContactManager.storageToFields());console.groupEnd()},fDynamicUpdate=function(a){var b=a instanceof Element,f=b&&"INPUT"==a.tagName&&"submit"==a.type,e=b&&"SPAN"==a.tagName&&("f_nav-mini"==a.parentNode.id||"f_nav-fiche"==a.parentNode.id),b=b&&"SPAN"==a.tagName&&"f_nav-contact"==a.parentNode.id;if(!f&&!e&&!b&&!0!==a)return!1;console.groupEnd();console.groupEnd();console.group("[facebook] Dynamic Update");fMiniManager.fieldsToStorage();
|
||||
fFicheManager.fieldsToStorage();fContactManager.fieldsToStorage();fMatriceManager.fieldsToStorage();fFicheManager.sync();fMiniManager.sync();!0===a?api.send({path:"subject/getFriends",subject_id:fSubjectManager.subject_id.value},function(a){if(0!=a.ModuleError)return console.groupEnd(),!1;lsi["import"]("f_friends",a.subjects);fMiniManager.storageToFields();fFicheManager.storageToFields();fMatriceManager.storageToFields();fContactManager.storageToFields()}):(fMiniManager.storageToFields(),fFicheManager.storageToFields(),
|
||||
fMatriceManager.storageToFields(),(c||b)&&fContactManager.storageToFields());console.groupEnd()};function testContactsPhone(){for(var a=0;45>a;a++)0==a%20?lsi.set("p_contacts",a,{uid:a,username:"contact-x"}):lsi.set("p_contacts",a,{uid:a,username:"contact-"+a})}
|
||||
function testRoutinePhone(a){var b=lsi["export"]("p_contacts"),c=lsi["export"]("p_mini-fiches"),g=lsi["export"]("p_fiches"),d=0;if(null!=a&&a)for(var f in c)isNaN(f)||(a="",null!=b[f]&&(a=b[f].username),c=$('#p_nav-mini [data-n="'+f+'"]'),c.click(),$("#unknown_min_p_"+f).checked=0==a.length,0==a.length?($("#sexeI_mini_p_"+f).checked=!0,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="age"]').value=d%19,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="studies"]').value=
|
||||
0,$("#reltype9_mini_p_"+f).checked=!0):(a=["H","F"][Math.floor(d%2)],$("#sexe"+a+"_mini_p_"+f).checked=!0,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="age"]').value=d%19,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="studies"]').value=1+d%6,a=d%10,9==a?($("#reltype10_mini_p_"+f).checked=!0,$('input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_mini_p_"+f).checked=!0,d++));for(var e in g)isNaN(e)||(c=$('#p_nav-fiche [data-n="'+
|
||||
e+'"]'),c.click(),a=["H","F","I"][Math.floor(d%3)],$("#sexe"+a+"_p_"+e).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="age"]').value=d%19,b="10 21 22 23 31 32 36 41 46 47 48 51 54 55 56 61 66 69 71 72 73 74 75 76 81 82".split(" "),b=b[d%b.length],$('article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="job"]').value=b,b=(d%12).toString(),1==b.length&&(b="0"+b),$('article.fiche-relation > input[data-name="uid"][value="'+
|
||||
e+'"] ~ h5 select[data-name="studies"]').value=b,a=d%9,8==a?($("#reltype10_p_"+e).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_p_"+e).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="city"]').value=(10+d).toString(),$('article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="cp"]').value=(1E4+d).toString(),$('article.fiche-relation > input[data-name="uid"][value="'+
|
||||
e+'"] ~ h5 input[data-name="quartier"]').value=d,$("#loc"+["A","B","C","D"][Math.floor(d%4)]+"_p_"+e).checked=!0,b=$$('article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="duration"]'),b[0].value=d.toString(),b[1].value=1+d.toString(),b=d%14,$("article.fiche-relation #contexte"+b+"_p_"+e).checked=!0,g=$$('article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="contextSpecial"]'),11==b&&(g[0].value="internet"),12==b&&(g[1].value="association"),
|
||||
13==b&&(g[2].value="autre"),d++)}function testContactsFacebook(){for(var a=0;45>a;a++)0==a%20?lsi.set("f_contacts",a,{uid:a,username:"contact-x"}):lsi.set("f_contacts",a,{uid:a,username:"contact-"+a})}
|
||||
function testRoutineFacebook(a){var b=lsi["export"]("f_contacts"),c=lsi["export"]("f_mini-fiches"),g=lsi["export"]("f_fiches"),d=0;if(null!=a&&a)for(var f in c)isNaN(f)||(a="",null!=b[f]&&(a=b[f].username),c=$('#f_nav-mini [data-n="'+f+'"]'),c.click(),$("#unknown_min_f_"+f).checked=0==a.length,0==a.length?($("#sexeI_mini_f_"+f).checked=!0,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="age"]').value=d%19,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="studies"]').value=
|
||||
0,$("#reltype9_mini_f_"+f).checked=!0):(a=["H","F"][Math.floor(d%2)],$("#sexe"+a+"_mini_f_"+f).checked=!0,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="age"]').value=d%19,$('input[data-name="uid"][value="'+f+'"] ~ h5 select[data-name="studies"]').value=1+d%6,a=d%10,9==a?($("#reltype10_mini_f_"+f).checked=!0,$('input[data-name="uid"][value="'+f+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_mini_f_"+f).checked=!0,d++));for(var e in g)isNaN(e)||(c=$('#f_nav-fiche [data-n="'+
|
||||
e+'"]'),c.click(),a=["H","F","I"][Math.floor(d%3)],$("#sexe"+a+"_f_"+e).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="age"]').value=d%19,b="10 21 22 23 31 32 36 41 46 47 48 51 54 55 56 61 66 69 71 72 73 74 75 76 81 82".split(" "),b=b[d%b.length],$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="job"]').value=b,b=(d%12).toString(),1==b.length&&
|
||||
(b="0"+b),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 select[data-name="studies"]').value=b,a=d%9,8==a?($("#reltype10_f_"+e).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_f_"+e).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="city"]').value=
|
||||
(10+d).toString(),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="cp"]').value=(1E4+d).toString(),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="quartier"]').value=d,$("#loc"+["A","B","C","D"][Math.floor(d%4)]+"_f_"+e).checked=!0,b=$$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="duration"]'),
|
||||
b[0].value=d.toString(),b[1].value=1+d.toString(),b=d%14,$('section[data-sublink="facebook"] article.fiche-relation #contexte'+b+"_f_"+e).checked=!0,g=$$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+e+'"] ~ h5 input[data-name="contextSpecial"]'),11==b&&(g[0].value="internet"),12==b&&(g[1].value="association"),13==b&&(g[2].value="autre"),d++)};
|
||||
fMatriceManager.storageToFields(),(f||b)&&fContactManager.storageToFields());console.groupEnd()};function testContactsPhone(){for(var a=0;45>a;a++)0==a%20?lsi.set("p_contacts",a,{uid:a,username:"contact-x"}):lsi.set("p_contacts",a,{uid:a,username:"contact-"+a})}
|
||||
function testRoutinePhone(a){var b=lsi["export"]("p_contacts"),f=lsi["export"]("p_mini-fiches"),e=lsi["export"]("p_fiches"),c=0;if(null!=a&&a)for(var g in f)isNaN(g)||(a="",null!=b[g]&&(a=b[g].username),f=$('#p_nav-mini [data-n="'+g+'"]'),f.click(),$("#unknown_min_p_"+g).checked=0==a.length,0==a.length?($("#sexeI_mini_p_"+g).checked=!0,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="studies"]').value=
|
||||
0,$("#reltype9_mini_p_"+g).checked=!0):(a=["H","F"][Math.floor(c%2)],$("#sexe"+a+"_mini_p_"+g).checked=!0,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="studies"]').value=1+c%6,a=c%10,9==a?($("#reltype10_mini_p_"+g).checked=!0,$('input[data-name="uid"][value="'+g+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_mini_p_"+g).checked=!0,c++));for(var d in e)if(!isNaN(d)){f=
|
||||
$('#p_nav-fiche [data-n="'+d+'"]');f.click();a=["H","F","I"][Math.floor(c%3)];$("#sexe"+a+"_p_"+d).checked=!0;$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="age"]').value=c%19;b="10 21 22 23 31 32 36 41 46 47 48 51 54 55 56 61 66 69 71 72 73 74 75 76 81 82".split(" ");b=b[c%b.length];$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="job"]').value=b;b=(c%12).toString();1==b.length&&(b="0"+b);$('article.fiche-relation > input[data-name="uid"][value="'+
|
||||
d+'"] ~ h5 select[data-name="studies"]').value=b;a=c%8;7==a?($("#reltype10_p_"+d).checked=!0,$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_p_"+d).checked=!0;$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="city"]').value=(10+c).toString();$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="cp"]').value=(1E4+c).toString();$('article.fiche-relation > input[data-name="uid"][value="'+
|
||||
d+'"] ~ h5 input[data-name="quartier"]').value=c;$("#loc"+["A","B","C","D"][Math.floor(c%4)]+"_p_"+d).checked=!0;b=["A","B","C","D"][Math.floor(c%4)];$("#famsit"+b+"_p_"+d).checked=!0;b=["A","B","C","D"][Math.floor(c%4)];$("#famsit"+b+"_p_"+d).checked=!0;$("#medsoc"+["A","B","C","D"][Math.floor(c%4)]+"_p_"+d).checked=!0;$("#medrel"+["A","B","C"][Math.floor(c%3)]+"_p_"+d).checked=!0;b=$$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="duration"]');b[0].value=c.toString();
|
||||
b[1].value=1+c.toString();b=c%14;$("article.fiche-relation #contexte"+b+"_p_"+d).checked=!0;e=$$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="contextSpecial"]');11==b&&(e[0].value="internet");12==b&&(e[1].value="association");13==b&&(e[2].value="autre");b=["0","1","2","3","4"];b=b[c%b.length];$('article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="interest"]').value=b;b=["0","1","2","3","4"];b=b[c%b.length];$('article.fiche-relation > input[data-name="uid"][value="'+
|
||||
d+'"] ~ h5 select[data-name="relmark"]').value=b;for(b=0;5>b;b++)e=1+5*b+Math.floor(c%4),10>e&&(e="0"+e),$("#freq"+e+"_p_"+d).checked=!0;for(b=0;5>b;b++)e=1+5*b+Math.floor(c%4),10>e&&(e="0"+e),$("#irlfreq"+e+"_p_"+d).checked=!0;for(b=1;7>b;b++)e=1+Math.floor(c%2),$("#connect"+b+""+e+"_p_"+d).checked=!0;c++}}function testContactsFacebook(){for(var a=0;45>a;a++)0==a%20?lsi.set("f_contacts",a,{uid:a,username:"contact-x"}):lsi.set("f_contacts",a,{uid:a,username:"contact-"+a})}
|
||||
function testRoutineFacebook(a){var b=lsi["export"]("f_contacts"),f=lsi["export"]("f_mini-fiches"),e=lsi["export"]("f_fiches"),c=0;if(null!=a&&a)for(var g in f)isNaN(g)||(a="",null!=b[g]&&(a=b[g].username),f=$('#f_nav-mini [data-n="'+g+'"]'),f.click(),$("#unknown_min_f_"+g).checked=0==a.length,0==a.length?($("#sexeI_mini_f_"+g).checked=!0,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="studies"]').value=
|
||||
0,$("#reltype9_mini_f_"+g).checked=!0):(a=["H","F"][Math.floor(c%2)],$("#sexe"+a+"_mini_f_"+g).checked=!0,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="age"]').value=c%19,$('input[data-name="uid"][value="'+g+'"] ~ h5 select[data-name="studies"]').value=1+c%6,a=c%10,9==a?($("#reltype10_mini_f_"+g).checked=!0,$('input[data-name="uid"][value="'+g+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_mini_f_"+g).checked=!0,c++));for(var d in e)isNaN(d)||(f=$('#f_nav-fiche [data-n="'+
|
||||
d+'"]'),f.click(),a=["H","F","I"][Math.floor(c%3)],$("#sexe"+a+"_f_"+d).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="age"]').value=c%19,b="10 21 22 23 31 32 36 41 46 47 48 51 54 55 56 61 66 69 71 72 73 74 75 76 81 82".split(" "),b=b[c%b.length],$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="job"]').value=b,b=(c%12).toString(),1==b.length&&
|
||||
(b="0"+b),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 select[data-name="studies"]').value=b,a=c%9,8==a?($("#reltype10_f_"+d).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="reltypeSpecial"]').value="autre"):$("#reltype"+a+"_f_"+d).checked=!0,$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="city"]').value=
|
||||
(10+c).toString(),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="cp"]').value=(1E4+c).toString(),$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="quartier"]').value=c,$("#loc"+["A","B","C","D"][Math.floor(c%4)]+"_f_"+d).checked=!0,b=$$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="duration"]'),
|
||||
b[0].value=c.toString(),b[1].value=1+c.toString(),b=c%14,$('section[data-sublink="facebook"] article.fiche-relation #contexte'+b+"_f_"+d).checked=!0,e=$$('section[data-sublink="facebook"] article.fiche-relation > input[data-name="uid"][value="'+d+'"] ~ h5 input[data-name="contextSpecial"]'),11==b&&(e[0].value="internet"),12==b&&(e[1].value="association"),13==b&&(e[2].value="autre"),c++)};
|
||||
|
|
Loading…
Reference in New Issue