Migration des modifications de `phone.fiche` et `phone.mini` vers `facebook.fiche` et `facebook.mini` ?? Pb de timestamp et de synchronisation

This commit is contained in:
xdrm-brackets 2016-10-17 11:45:25 +02:00
parent 4f09c888bf
commit f8c0ef141f
4 changed files with 213 additions and 101 deletions

View File

@ -104,7 +104,8 @@ inputFacebookFiche.prototype.fieldsToStorage = function(){
console.log( diff(existingData, obj, ['hash', 'valid', 'timestamp']) ); console.log( diff(existingData, obj, ['hash', 'valid', 'timestamp']) );
console.warn('> FICHE UPDATE'); console.warn('> FICHE UPDATE');
obj.timestamp = Date.now(); obj.timestamp = Date.now();
} }else if( existingData['timestamp'] == undefined )
obj.timestamp = this.defaultData.timestamp;
/* (7) On enregistre les données dans le 'localStorage' */ /* (7) On enregistre les données dans le 'localStorage' */
lsi.set('f_fiches', obj.uid, obj); lsi.set('f_fiches', obj.uid, obj);
@ -352,19 +353,23 @@ inputFacebookFiche.prototype.storageToFields = function(){
inputFacebookFiche.prototype.sync = function(){ inputFacebookFiche.prototype.sync = function(){
console.group('[facebook.fiche] synchronisation'); console.group('[facebook.fiche] synchronisation');
/* (1) Initialisation
{ /* (1) Initialisation
---------------------------------------------------------*/ ---------------------------------------------------------*/
/* (1) On récupère tous les CONTACTS */ /* (1) On récupère tous les CONTACTS */
var contacts = lsi.export('f_contacts'); var contacts = lsi.export('f_contacts');
/* (2) Contiendra les uids des fiches qui seront crées */ /* (2) Contiendra les uids des fiches qui seront crées */
var addedFicheUids = []; var addedFicheUids = [];
var ficheData, contactData; var ficheData, contactData, miniData;
}
{ /* (2) Mise à jour en fonction des contacts APRÈS SAISIE
/* (2) Mise à jour en fonction des contacts APRÈS SAISIE
---------------------------------------------------------*/ ---------------------------------------------------------*/
// Nombre maximum de fiches (40, sauf si moins de 40 contacts, dans ce cas, le nombre de contacts); // Nombre maximum de fiches (40, sauf si moins de 40 contacts, dans ce cas, le nombre de contacts);
var nbMaxFiche = lsi.keys('f_contacts').length < 2*this.top_size ? lsi.keys('f_contacts').length : 2*this.top_size; var nbMaxFiche = lsi.keys('f_contacts').length < 2*this.top_size ? lsi.keys('f_contacts').length : 2*this.top_size;
@ -396,8 +401,102 @@ inputFacebookFiche.prototype.sync = function(){
break; break;
} }
}
/* (3) Gestion des fiches dupliquées
{ /* (3) Gestion des liens entre mini-fiches et fiches
---------------------------------------------------------*/
var hasSameUsername, hasSameLink;
ficheData = lsi.export('f_fiches');
miniData = lsi.export('f_mini-fiches');
// Pour chaque fiche
for( var key in ficheData ){
/* (1) On récupère le contact associé */
var associatedContact = lsi.get('f_contacts', ficheData[key].contact);
// Si erreur, on passe au suivant
if( !associatedContact )
continue;
/* (3) On récupère la mini-fiche clone si existe */
var clone = null;
// Pour chaque mini-fiche
for( var i in miniData ){
// on récupère le contact associé (si on est dans `call`, celui dans la tranche avec `sms` / et inversement)
contactData = lsi.get('f_contacts', miniData[i].contact);
if( !contactData )
continue;
// meme pseudo
hasSameUsername = contactData.username.length > 0 && associatedContact.username === contactData.username;
// meme lien de contact
hasSameLink = !isNaN(contactData.existing) && associatedContact.existing === contactData.existing;
// si ont le même contact, alors on enregistre le clone (sauf si la même fiche)
( hasSameUsername || hasSameLink ) && ( clone = miniData[i] );
if( clone !== null )
break;
}
/* (4) Si c'est le clone qui a été modifié en dernier, on ne fait rien */
var fiche_ts = ( ficheData[key].hasOwnProperty('timestamp') ) ? ficheData[key].timestamp : 0;
var mini_ts = ( clone instanceof Object && clone.hasOwnProperty('timestamp') ) ? clone.timestamp : 0;
if( clone === null )
continue;
/* (5.1) Si clone modifiée en dernier > On copie les données de la mini (CLONE) dans la FICHE */
var copied;
if( mini_ts > fiche_ts ){
console.warn('copying mini#'+clone.uid+' to fiche#'+ficheData[key].uid, mini_ts-global_start_timestamp, fiche_ts-global_start_timestamp);
copied = ficheData[key];
copied.age = clone.age;
copied.sexe = clone.sexe;
copied.loc = clone.loc;
copied.reltype = clone.reltype;
copied.reltypeSpecial = clone.reltypeSpecial;
copied.timestamp = Date.now();
lsi.set('f_fiches', copied.uid, copied);
// clone.timestamp = copied.timestamp;
// lsi.set('f_mini-fiches', clone.uid, clone);
/* (5.2) Si fiche modifiée en dernier > On copie les données de la FICHE dans la mini (CLONE) */
}else if( fiche_ts > mini_ts ){
// console.warn('copying fiche#'+ficheData[key].uid+' to mini#'+clone.uid, fiche_ts-global_start_timestamp, mini_ts-global_start_timestamp);
copied = clone;
copied.age = ficheData[key].age;
copied.sexe = ficheData[key].sexe;
copied.loc = ficheData[key].loc;
copied.reltype = ficheData[key].reltype;
copied.reltypeSpecial = ficheData[key].reltypeSpecial;
copied.timestamp = Date.now();
lsi.set('f_mini-fiches', copied.uid, copied);
// ficheData[key].timestamp = copied.timestamp;
// lsi.set('f_fiches', ficheData[key].uid, ficheData[key]);
}
}
}
{ /* (4) Gestion des fiches dupliquées
---------------------------------------------------------*/ ---------------------------------------------------------*/
ficheData = lsi.export('f_fiches'); ficheData = lsi.export('f_fiches');
@ -427,9 +526,9 @@ inputFacebookFiche.prototype.sync = function(){
continue; continue;
// meme pseudo // meme pseudo
var hasSameUsername = contactData.username.length > 0 && associatedContact.username === contactData.username; hasSameUsername = contactData.username.length > 0 && associatedContact.username === contactData.username;
// meme lien de contact // meme lien de contact
var hasSameLink = !isNaN(contactData.existing) && associatedContact.existing === contactData.existing; hasSameLink = !isNaN(contactData.existing) && associatedContact.existing === contactData.existing;
// si ont le même contact, alors on enregistre le clone (sauf si la même fiche) // si ont le même contact, alors on enregistre le clone (sauf si la même fiche)
( hasSameUsername || hasSameLink ) && ( clone = ficheData[i] ); ( hasSameUsername || hasSameLink ) && ( clone = ficheData[i] );
@ -439,20 +538,30 @@ inputFacebookFiche.prototype.sync = function(){
} }
/* (4) Si c'est le clone qui a été modifié en dernier, on ne fait rien */ /* (4) Si c'est le clone qui a été modifié en dernier, on ne fait rien */
var fiche_ts = ( ficheData[key].hasOwnProperty('timestamp') ) ? ficheData[key].timestamp : 0; var fiche_ts = ( ficheData[key].hasOwnProperty('timestamp') ) ? ficheData[key].timestamp : 0;
var clone_ts = ( clone instanceof Object && clone.hasOwnProperty('timestamp') ) ? clone.timestamp : 0; var clone_ts = ( clone instanceof Object && clone.hasOwnProperty('timestamp') ) ? clone.timestamp : 0;
if( clone === null || clone_ts > fiche_ts ) if( clone === null || clone_ts > fiche_ts )
continue; continue;
// console.warn('copying fiche#'+ficheData[key].uid+' to fiche#'+clone.uid, fiche_ts-global_start_timestamp, clone_ts-global_start_timestamp);
/* (5) On copie les données de la FICHE dans le CLONE */ /* (5) On copie les données de la FICHE dans le CLONE */
var obj = ficheData[key]; var copied = ficheData[key];
obj.uid = clone.uid; copied.uid = clone.uid;
obj.timestamp = Date.now(); // copied.timestamp = Date.now();
lsi.set('f_fiches', clone.uid, obj); lsi.set('f_fiches', copied.uid, copied);
// ficheData[key].timestamp = copied.timestamp;
// lsi.set('f_fiches', ficheData[key].uid, ficheData[key]);
} }
}
console.groupEnd(); console.groupEnd();
}; };

View File

@ -82,7 +82,8 @@ inputFacebookMini.prototype.fieldsToStorage = function(){
console.log( diff(existingData, obj, ['hash', 'valid', 'timestamp']) ); console.log( diff(existingData, obj, ['hash', 'valid', 'timestamp']) );
console.warn('> FICHE UPDATE'); console.warn('> FICHE UPDATE');
obj.timestamp = Date.now(); obj.timestamp = Date.now();
} }else if( existingData['timestamp'] == undefined )
obj.timestamp = this.defaultData.timestamp;
/* (9) On enregistre les données dans le 'localStorage' */ /* (9) On enregistre les données dans le 'localStorage' */

View File

@ -1,21 +1,23 @@
function inputFacebookFiche(a,c){this.container=a;this.nav_container=c;this.top_size=10}inputFacebookFiche.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:"2",age:".",job:".",famsit:"0",studies:"0",reltype:"0",reltypeSpecial:"",city:"",quartier:"",cp:"",loc:"0",duration:["",""],context:"0",contextSpecial:["","",""],freq:["4","9","14","19","24"],connect:"1 3 5 7 9 11".split(" "),connectSpecial:["",""],timestamp:0,valid:!1}}; function inputFacebookFiche(a,b){this.container=a;this.nav_container=b;this.top_size=10}inputFacebookFiche.prototype={container:this.container,nav_container:this.nav_container,selected:0,handler:null,defaultData:{sexe:"2",age:".",job:".",famsit:"0",studies:"0",reltype:"0",reltypeSpecial:"",city:"",quartier:"",cp:"",loc:"0",duration:["",""],context:"0",contextSpecial:["","",""],freq:["4","9","14","19","24"],connect:"1 3 5 7 9 11".split(" "),connectSpecial:["",""],timestamp:0,valid:!1}};
inputFacebookFiche.prototype.fieldsToStorage=function(){console.group("[facebook.fiche] fields to storage");for(var a=$$('[data-sublink="facebook"] article.relation-panel .fiche-relation'),c=0;c<a.length;c++){var b=(new FormDeflater(a[c],["input","select"],["data-name"])).deflate(),d=crc32(JSON.stringify(b)),e=lsi.get("f_fiches",b.uid);if(!1!==e){if(null!=e.hash&&e.hash==d)return;b={contact:parseInt(b.contact),uid:parseInt(b.uid),sexe:b.sexe,age:b.age,job:b.job,famsit:b.famsit,studies:b.studies,reltype:b.reltype, inputFacebookFiche.prototype.fieldsToStorage=function(){console.group("[facebook.fiche] fields to storage");for(var a=$$('[data-sublink="facebook"] 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("f_fiches",c.uid);if(!1!==d){if(null!=d.hash&&d.hash==e)return;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:b.reltypeSpecial,city:b.city,quartier:b.quartier,cp:b.cp,loc:b.loc,duration:b.duration,context:b.context,contextSpecial:b.contextSpecial,freq:b.freq,connect:b.connect,connectSpecial:b.connectSpecial,hash:d};b.valid=this.check(b);0<diff(e,b,["hash","valid","timestamp"]).length&&(console.log(diff(e,b,["hash","valid","timestamp"])),console.warn("> FICHE UPDATE"),b.timestamp=Date.now());lsi.set("f_fiches",b.uid,b)}}console.groupEnd()}; reltypeSpecial:c.reltypeSpecial,city:c.city,quartier:c.quartier,cp:c.cp,loc:c.loc,duration:c.duration,context:c.context,contextSpecial:c.contextSpecial,freq:c.freq,connect:c.connect,connectSpecial:c.connectSpecial,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()):void 0==d.timestamp&&(c.timestamp=this.defaultData.timestamp);lsi.set("f_fiches",c.uid,c)}}console.groupEnd()};
inputFacebookFiche.prototype.add=function(a){if(null==a.uid||isNaN(a.uid)||null==a.contact||isNaN(a.contact))return!1;a.city=null!=a.city?a.city:this.defaultData.city;a.quartier=null!=a.quartier?a.quartier:this.defaultData.quartier;a.cp=null!=a.cp?a.cp:this.defaultData.cp;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; inputFacebookFiche.prototype.add=function(a){if(null==a.uid||isNaN(a.uid)||null==a.contact||isNaN(a.contact))return!1;a.city=null!=a.city?a.city:this.defaultData.city;a.quartier=null!=a.quartier?a.quartier:this.defaultData.quartier;a.cp=null!=a.cp?a.cp:this.defaultData.cp;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.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: 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 c=lsi.get("f_contacts",a.contact);if(!1===c)return!1;var b="";isNaN(c.existing)||(b=lsi.get("f_friends",c.existing),c.username=b.name,a.age=b.age,a.sexe=b.sexe,a.loc=b.dist,isNaN(b.reltype)?(a.reltype=10,a.reltypeSpecial=b.reltype):(a.reltype=b.reltype,a.reltypeSpecial=""),null!=b.studies2?(a.studies=b.studies2,a.job=b.job,a.famsit=b.famsit,a.city=b.city,a.cp=b.cp,a.quartier=b.quartier,a.duration[0]=b.duration[0],a.duration[1]=b.duration[1],a.context=b.context,a.contextSpecial= this.defaultData.connect;var b=lsi.get("f_contacts",a.contact);if(!1===b)return!1;var c="";isNaN(b.existing)||(c=lsi.get("f_friends",b.existing),b.username=c.name,a.age=c.age,a.sexe=c.sexe,a.loc=c.dist,isNaN(c.reltype)?(a.reltype=10,a.reltypeSpecial=c.reltype):(a.reltype=c.reltype,a.reltypeSpecial=""),null!=c.studies2?(a.studies=c.studies2,a.job=c.job,a.famsit=c.famsit,a.city=c.city,a.cp=c.cp,a.quartier=c.quartier,a.duration[0]=c.duration[0],a.duration[1]=c.duration[1],a.context=c.context,a.contextSpecial=
b.contextExtra,a.connect=b.connect,a.connectSpecial=b.connectExtra,a.freq=b.freq,b="Contact import\u00e9: non modifiable!"):b="Contact import\u00e9 (incomplet): modifiable partiellement!");this.container.innerHTML+=fFicheBuilder.build({importedfiche:b,name:c.username,countcall:c.countcall,countsms:c.countsms,uid:a.uid,contact:a.contact,city:a.city,quartier:a.quartier,cp:a.cp,duration0:a.duration[0],duration1:a.duration[1],reltypespecial:a.reltypeSpecial,contextspecial0:a.contextSpecial[0],contextspecial1:a.contextSpecial[1], c.contextExtra,a.connect=c.connect,a.connectSpecial=c.connectExtra,a.freq=c.freq,c="Contact import\u00e9: non modifiable!"):c="Contact import\u00e9 (incomplet): modifiable partiellement!");this.container.innerHTML+=fFicheBuilder.build({importedfiche:c,name:b.username,countcall:b.countcall,countsms:b.countsms,uid:a.uid,contact:a.contact,city:a.city,quartier:a.quartier,cp:a.cp,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]});c=$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="job"]>option[value="'+a.job+'"]');null!=c&&c.setAttribute("selected","selected");c=$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="studies"]>option[value="'+a.studies+'"]');null!=c&&c.setAttribute("selected", contextspecial2:a.contextSpecial[2],connectspecial0:a.connectSpecial[0],connectspecial1:a.connectSpecial[1]});b=$('[data-sublink="facebook"] 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=$('[data-sublink="facebook"] 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");c=$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="age"]>option[value="'+a.age+'"]');null!=c&&c.setAttribute("selected","selected");b=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]');for(c=0;c<b.length;c++)b[c].value==a.sexe?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+ "selected");b=$('[data-sublink="facebook"] 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");c=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]');for(b=0;b<c.length;b++)c[b].value==a.sexe?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+
a.uid+'"] ~ h5>input[type="radio"][data-name="famsit"]');for(c=0;c<b.length;c++)b[c].value==a.famsit?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');for(c=0;c<b.length;c++)b[c].value==a.reltype?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] 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=$$('[data-sublink="facebook"] 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=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+
a.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');for(c=0;c<b.length;c++)b[c].value==a.loc?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="context"]');for(c=0;c<b.length;c++)b[c].value==a.context?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] 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=$$('[data-sublink="facebook"] 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=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+
a.uid+'"] ~ h5>input[type="radio"][data-name="freq"]');for(c=0;c<b.length;c++)-1<a.freq.indexOf(b[c].value)?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="connect"]');for(c=0;c<b.length;c++)-1<a.connect.indexOf(b[c].value)?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked")}; a.uid+'"] ~ h5>input[type="radio"][data-name="freq"]');for(b=0;b<c.length;b++)-1<a.freq.indexOf(c[b].value)?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked");c=$$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="connect"]');for(b=0;b<c.length;b++)-1<a.connect.indexOf(c[b].value)?c[b].setAttribute("checked","checked"):c[b].removeAttribute("checked")};
inputFacebookFiche.prototype.storageToFields=function(){console.group("[facebook.fiche] storage to fields");var a=lsi["export"]("f_fiches");this.container.innerHTML="";for(var c in a)a[c].uid==this.selected&&this.add(a[c]);this.updateNavBar();console.groupEnd()}; inputFacebookFiche.prototype.storageToFields=function(){console.group("[facebook.fiche] storage to fields");var a=lsi["export"]("f_fiches");this.container.innerHTML="";for(var b in a)a[b].uid==this.selected&&this.add(a[b]);this.updateNavBar();console.groupEnd()};
inputFacebookFiche.prototype.sync=function(){console.group("[facebook.fiche] synchronisation");var a=lsi["export"]("f_contacts"),c=[],b,d=lsi.keys("f_contacts").length<2*this.top_size?lsi.keys("f_contacts").length:2*this.top_size,e;for(e in a){for(ficheUid=0;-1<c.indexOf(ficheUid)&&ficheUid<d;)ficheUid++;c.push(ficheUid);a=lsi.get("f_fiches",ficheUid);!a&&(a=this.defaultData);a.uid=ficheUid;a.contact=parseInt(e);lsi.set("f_fiches",ficheUid,a);if(c.length>=d)break}var a=lsi["export"]("f_fiches"),f; inputFacebookFiche.prototype.sync=function(){console.group("[facebook.fiche] synchronisation");var a=lsi["export"]("f_contacts"),b=[],c,e;e=lsi.keys("f_contacts").length<2*this.top_size?lsi.keys("f_contacts").length:2*this.top_size;for(var d in a){for(ficheUid=0;-1<b.indexOf(ficheUid)&&ficheUid<e;)ficheUid++;b.push(ficheUid);a=lsi.get("f_fiches",ficheUid);!a&&(a=this.defaultData);a.uid=ficheUid;a.contact=parseInt(d);lsi.set("f_fiches",ficheUid,a);if(b.length>=e)break}a=lsi["export"]("f_fiches");e=
for(f in a)if(d=lsi.get("f_contacts",a[f].contact)){c=null;e=parseInt(a[f].uid)<this.top_size;for(var g in a)if(!(e&&g<this.top_size||!e&&g>=this.top_size)&&(b=lsi.get("f_contacts",a[g].contact),g!=f&&b)){var h=0<b.username.length&&d.username===b.username;b=!isNaN(b.existing)&&d.existing===b.existing;(h||b)&&(c=a[g]);if(null!==c)break}d=a[f].hasOwnProperty("timestamp")?a[f].timestamp:0;e=c instanceof Object&&c.hasOwnProperty("timestamp")?c.timestamp:0;null===c||e>d||(d=a[f],d.uid=c.uid,d.timestamp= lsi["export"]("f_mini-fiches");for(var f in a){var g=lsi.get("f_contacts",a[f].contact);if(g){var b=null,h;for(h in e)if(c=lsi.get("f_contacts",e[h].contact))if(d=0<c.username.length&&g.username===c.username,c=!isNaN(c.existing)&&g.existing===c.existing,(d||c)&&(b=e[h]),null!==b)break;d=a[f].hasOwnProperty("timestamp")?a[f].timestamp:0;g=b instanceof Object&&b.hasOwnProperty("timestamp")?b.timestamp:0;null!==b&&(g>d?(console.warn("copying mini#"+b.uid+" to fiche#"+a[f].uid,g-global_start_timestamp,
Date.now(),lsi.set("f_fiches",c.uid,d))}console.groupEnd()};inputFacebookFiche.prototype.nav=function(a){if(!(a instanceof Element&&a.getData("n"))||isNaN(a.getData("n"))||"f_nav-fiche"!=a.parentNode.id)return!1;for(var c=$$('[data-sublink="facebook"] #f_nav-fiche > span.active'),b=0;b<c.length;b++)c[b].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))}; d-global_start_timestamp),d=a[f],d.age=b.age,d.sexe=b.sexe,d.loc=b.loc,d.reltype=b.reltype,d.reltypeSpecial=b.reltypeSpecial,d.timestamp=Date.now(),lsi.set("f_fiches",d.uid,d)):d>g&&(d=b,d.age=a[f].age,d.sexe=a[f].sexe,d.loc=a[f].loc,d.reltype=a[f].reltype,d.reltypeSpecial=a[f].reltypeSpecial,d.timestamp=Date.now(),lsi.set("f_mini-fiches",d.uid,d)))}}a=lsi["export"]("f_fiches");for(f in a)if(g=lsi.get("f_contacts",a[f].contact)){b=null;e=parseInt(a[f].uid)<this.top_size;for(h in a)if(!(e&&h<this.top_size||
inputFacebookFiche.prototype.updateNavBar=function(){var a=lsi["export"]("f_fiches");this.nav_container.innerHTML="";for(var c=Object.keys(a),b=0;b<c.length;b++){var d=parseInt(c[b]);0==d&&(this.nav_container.innerHTML+="<span>HISTORIQUE</span>");20>d&&b<c.length-1&&20<=c[b+1]?this.nav_container.innerHTML+='<span data-n="'+d+'" class="lc">'+(d%20+1)+"</span>&nbsp;&nbsp;":(20==d&&(this.nav_container.innerHTML+='<br><span class="fc">MESSENGER&nbsp;</span>'),this.nav_container.innerHTML+='<span data-n="'+ !e&&h>=this.top_size)&&(c=lsi.get("f_contacts",a[h].contact),h!=f&&c&&(d=0<c.username.length&&g.username===c.username,c=!isNaN(c.existing)&&g.existing===c.existing,(d||c)&&(b=a[h]),null!==b)))break;d=a[f].hasOwnProperty("timestamp")?a[f].timestamp:0;e=b instanceof Object&&b.hasOwnProperty("timestamp")?b.timestamp:0;null===b||e>d||(d=a[f],d.uid=b.uid,lsi.set("f_fiches",d.uid,d))}console.groupEnd()};
d+'">'+(d%20+1)+"</span>")}for(var e in a)c=$('[data-sublink="facebook"] #f_nav-fiche [data-n="'+a[e].uid+'"]'),null!=c&&(!0===a[e].valid?c.addClass("done"):c.remClass("done"));this.nav($('[data-sublink="facebook"] #f_nav-fiche [data-n="'+this.selected+'"]'))}; inputFacebookFiche.prototype.nav=function(a){if(!(a instanceof Element&&a.getData("n"))||isNaN(a.getData("n"))||"f_nav-fiche"!=a.parentNode.id)return!1;for(var b=$$('[data-sublink="facebook"] #f_nav-fiche > span.active'),c=0;c<b.length;c++)b[c].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))};
inputFacebookFiche.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||""==a.sexe||""==a.famsit||""==a.reltype||""==a.loc||""==a.context)return!1;for(var c=0;c<a.freq.length;c++)if(""==a.freq[c])return!1;for(c=0;c<a.connect.length;c++)if(""==a.connect[c])return!1;return"10"==a.reltype&&2>a.reltypeSpecial.length|| inputFacebookFiche.prototype.updateNavBar=function(){var a=lsi["export"]("f_fiches");this.nav_container.innerHTML="";for(var b=Object.keys(a),c=0;c<b.length;c++){var e=parseInt(b[c]);0==e&&(this.nav_container.innerHTML+="<span>HISTORIQUE</span>");20>e&&c<b.length-1&&20<=b[c+1]?this.nav_container.innerHTML+='<span data-n="'+e+'" class="lc">'+(e%20+1)+"</span>&nbsp;&nbsp;":(20==e&&(this.nav_container.innerHTML+='<br><span class="fc">MESSENGER&nbsp;</span>'),this.nav_container.innerHTML+='<span data-n="'+
"11"==a.context&&2>a.contextSpecial[0].length||"12"==a.context&&2>a.contextSpecial[1].length||"13"==a.context&&2>a.contextSpecial[2].length?!1:!0};inputFacebookFiche.prototype.attach=function(a){console.group("[facebook.fiche] attaching events");lsi.createDataset("f_fiches");this.storageToFields();this.handler=a;var c=this,c=this;this.nav_container.addEventListener("click",function(a){c.nav(a.target);c.handler(a.target)},!1);console.groupEnd()}; e+'">'+(e%20+1)+"</span>")}for(var d in a)b=$('[data-sublink="facebook"] #f_nav-fiche [data-n="'+a[d].uid+'"]'),null!=b&&(!0===a[d].valid?b.addClass("done"):b.remClass("done"));this.nav($('[data-sublink="facebook"] #f_nav-fiche [data-n="'+this.selected+'"]'))};
inputFacebookFiche.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||""==a.sexe||""==a.famsit||""==a.reltype||""==a.loc||""==a.context)return!1;for(var b=0;b<a.freq.length;b++)if(""==a.freq[b])return!1;for(b=0;b<a.connect.length;b++)if(""==a.connect[b])return!1;return"10"==a.reltype&&2>a.reltypeSpecial.length||
"11"==a.context&&2>a.contextSpecial[0].length||"12"==a.context&&2>a.contextSpecial[1].length||"13"==a.context&&2>a.contextSpecial[2].length?!1:!0};inputFacebookFiche.prototype.attach=function(a){console.group("[facebook.fiche] attaching events");lsi.createDataset("f_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);console.groupEnd()};

View File

@ -1,13 +1,13 @@
function inputFacebookMini(a,c){this.container=a;this.nav_container=c}inputFacebookMini.prototype={container:this.container,nav_container:this.nav_container,selected:null,handler:null,defaultData:{sexe:"2",age:".",studies:"0",loc:".",reltype:"9",unknown:!1,reltypeSpecial:"",timestamp:0,valid:!1}}; function inputFacebookMini(a,c){this.container=a;this.nav_container=c}inputFacebookMini.prototype={container:this.container,nav_container:this.nav_container,selected:null,handler:null,defaultData:{sexe:"2",age:".",studies:"0",loc:".",reltype:"9",unknown:!1,reltypeSpecial:"",timestamp:0,valid:!1}};
inputFacebookMini.prototype.fieldsToStorage=function(){console.group("[facebook.mini] fields to storage");for(var a=$$('[data-sublink="facebook"] article.mini-relation-panel .mini-fiche-relation'),c=0;c<a.length;c++){var b=(new FormDeflater(a[c],["input","select"],["data-name"])).deflate(),d=crc32(JSON.stringify(b)),e=lsi.get("f_mini-fiches",b.uid);if(!1!==e){if(null!=e&&null!=e.hash&&e.hash==d)return;console.warn("> MINI UPDATE");b={uid:parseInt(b.uid),sexe:b.sexe,age:b.age,studies:b.studies,reltype:b.reltype, inputFacebookMini.prototype.fieldsToStorage=function(){console.group("[facebook.mini] fields to storage");for(var a=$$('[data-sublink="facebook"] article.mini-relation-panel .mini-fiche-relation'),c=0;c<a.length;c++){var b=(new FormDeflater(a[c],["input","select"],["data-name"])).deflate(),e=crc32(JSON.stringify(b)),d=lsi.get("f_mini-fiches",b.uid);if(!1!==d){if(null!=d&&null!=d.hash&&d.hash==e)return;console.warn("> MINI UPDATE");b={uid:parseInt(b.uid),sexe:b.sexe,age:b.age,studies:b.studies,reltype:b.reltype,
reltypeSpecial:b.reltypeSpecial,loc:b.loc,unknown:null!=b.unknown,hash:d};b.valid=this.check(b);0<diff(e,b,["hash","valid","timestamp"]).length&&(console.log(diff(e,b,["hash","valid","timestamp"])),console.warn("> FICHE UPDATE"),b.timestamp=Date.now());lsi.set("f_mini-fiches",b.uid,b)}}console.groupEnd()}; reltypeSpecial:b.reltypeSpecial,loc:b.loc,unknown:null!=b.unknown,hash:e};b.valid=this.check(b);0<diff(d,b,["hash","valid","timestamp"]).length?(console.log(diff(d,b,["hash","valid","timestamp"])),console.warn("> FICHE UPDATE"),b.timestamp=Date.now()):void 0==d.timestamp&&(b.timestamp=this.defaultData.timestamp);lsi.set("f_mini-fiches",b.uid,b)}}console.groupEnd()};
inputFacebookMini.prototype.add=function(a){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;a.unknown=null!=a.unknown?a.unknown:this.defaultData.unknown;var c=lsi.get("f_contacts", inputFacebookMini.prototype.add=function(a){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;a.unknown=null!=a.unknown?a.unknown:this.defaultData.unknown;var c=lsi.get("f_contacts",
a.uid);if(!1===c)return!1;if(!isNaN(c.existing)){var b=lsi.get("f_friends",c.existing);c.username=b.name;a.age=b.age;a.sexe=b.sexe;a.loc=b.dist;isNaN(b.reltype)?(a.reltype=10,a.reltypeSpecial=b.reltype):(a.reltype=b.reltype,a.reltypeSpecial="");null!=b.studies1&&(a.studies=b.studies1)}this.container.innerHTML+=fMiniFicheBuilder.build({name:c.username,uid:a.uid,reltypespecial:a.reltypeSpecial});c=$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="studies"]>option[value="'+ a.uid);if(!1===c)return!1;if(!isNaN(c.existing)){var b=lsi.get("f_friends",c.existing);c.username=b.name;a.age=b.age;a.sexe=b.sexe;a.loc=b.dist;isNaN(b.reltype)?(a.reltype=10,a.reltypeSpecial=b.reltype):(a.reltype=b.reltype,a.reltypeSpecial="");null!=b.studies1&&(a.studies=b.studies1)}this.container.innerHTML+=fMiniFicheBuilder.build({name:c.username,uid:a.uid,reltypespecial:a.reltypeSpecial});c=$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="studies"]>option[value="'+
a.studies+'"]');null!=c&&c.setAttribute("selected","selected");c=$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="age"]>option[value="'+a.age+'"]');null!=c&&c.setAttribute("selected","selected");b=$$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]');for(c=0;c<b.length;c++)b[c].value==a.sexe?b[c].setAttribute("checked","checked"): a.studies+'"]');null!=c&&c.setAttribute("selected","selected");c=$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="age"]>option[value="'+a.age+'"]');null!=c&&c.setAttribute("selected","selected");b=$$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="sexe"]');for(c=0;c<b.length;c++)b[c].value==a.sexe?b[c].setAttribute("checked","checked"):
b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');for(c=0;c<b.length;c++)b[c].value==a.reltype?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');for(c=0;c<b.length;c++)b[c].value==a.loc?b[c].setAttribute("checked", b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="reltype"]');for(c=0;c<b.length;c++)b[c].value==a.reltype?b[c].setAttribute("checked","checked"):b[c].removeAttribute("checked");b=$$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="radio"][data-name="loc"]');for(c=0;c<b.length;c++)b[c].value==a.loc?b[c].setAttribute("checked",
"checked"):b[c].removeAttribute("checked");c=$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="checkbox"][data-name="unknown"]');null!=c&&a.unknown&&c.setAttribute("checked","checked")}; "checked"):b[c].removeAttribute("checked");c=$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>input[type="checkbox"][data-name="unknown"]');null!=c&&a.unknown&&c.setAttribute("checked","checked")};
inputFacebookMini.prototype.storageToFields=function(){console.group("[facebook.mini] storage to fields");var a=lsi.get("f_mini-fiches",this.selected);if(null===a){if(null===this.selected)return a=lsi.keys("f_mini-fiches"),0<a.length?(this.selected=a[0],this.storageToFields()):!1;this.updateNavBar();return!1}this.container.innerHTML="";this.add(a);this.updateNavBar();console.groupEnd()}; inputFacebookMini.prototype.storageToFields=function(){console.group("[facebook.mini] storage to fields");var a=lsi.get("f_mini-fiches",this.selected);if(null===a){if(null===this.selected)return a=lsi.keys("f_mini-fiches"),0<a.length?(this.selected=a[0],this.storageToFields()):!1;this.updateNavBar();return!1}this.container.innerHTML="";this.add(a);this.updateNavBar();console.groupEnd()};
inputFacebookMini.prototype.sync=function(){console.group("[facebook.mini] synchronisation");var a=lsi["export"]("f_contacts"),c=lsi["export"]("f_fiches"),b=[],d;for(d in c)-1==b.indexOf(c[d].contact)&&b.push(c[d].contact);for(var e in a)-1<b.indexOf(parseInt(e))?lsi.del("f_mini-fiches",e):(c=0==a[e].username.length?e.toString()+"-":e,d=lsi.get("f_mini-fiches",c),null==d&&(d=this.defaultData,d.valid=!1,isNaN(c)&&(d.reltype="9")),d.uid=parseInt(e),lsi.set("f_mini-fiches",c,d));d=lsi["export"]("f_mini-fiches"); inputFacebookMini.prototype.sync=function(){console.group("[facebook.mini] synchronisation");var a=lsi["export"]("f_contacts"),c=lsi["export"]("f_fiches"),b=[],e;for(e in c)-1==b.indexOf(c[e].contact)&&b.push(c[e].contact);for(var d in a)-1<b.indexOf(parseInt(d))?lsi.del("f_mini-fiches",d):(c=0==a[d].username.length?d.toString()+"-":d,e=lsi.get("f_mini-fiches",c),null==e&&(e=this.defaultData,e.valid=!1,isNaN(c)&&(e.reltype="9")),e.uid=parseInt(d),lsi.set("f_mini-fiches",c,e));e=lsi["export"]("f_mini-fiches");
if(null==d[this.selected])for(e in d)if(!isNaN(e)){this.selected=parseInt(e);break}console.groupEnd()};inputFacebookMini.prototype.nav=function(a){if(!(a instanceof Element&&a.getData("n"))||isNaN(a.getData("n"))||"f_nav-mini"!=a.parentNode.id)return!1;for(var c=$$('[data-sublink="facebook"] #f_nav-mini > span.active'),b=0;b<c.length;b++)c[b].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))}; if(null==e[this.selected])for(d in e)if(!isNaN(d)){this.selected=parseInt(d);break}console.groupEnd()};inputFacebookMini.prototype.nav=function(a){if(!(a instanceof Element&&a.getData("n"))||isNaN(a.getData("n"))||"f_nav-mini"!=a.parentNode.id)return!1;for(var c=$$('[data-sublink="facebook"] #f_nav-mini > span.active'),b=0;b<c.length;b++)c[b].remClass("active");a.addClass("active");this.selected=parseInt(a.getData("n"))};
inputFacebookMini.prototype.updateNavBar=function(){var a=lsi["export"]("f_mini-fiches");this.nav_container.innerHTML="";var c=0,b;for(b in a)isNaN(b)||(this.nav_container.innerHTML+='<span data-n="'+b+'">'+ ++c+"</span>");for(b in a)isNaN(b)||(c=$('[data-sublink="facebook"] #f_nav-mini [data-n="'+a[b].uid+'"]'),null!=c&&(!0===a[b].valid?c.addClass("done"):c.remClass("done")));this.nav($('[data-sublink="facebook"] #f_nav-mini [data-n="'+this.selected+'"]'))}; inputFacebookMini.prototype.updateNavBar=function(){var a=lsi["export"]("f_mini-fiches");this.nav_container.innerHTML="";var c=0,b;for(b in a)isNaN(b)||(this.nav_container.innerHTML+='<span data-n="'+b+'">'+ ++c+"</span>");for(b in a)isNaN(b)||(c=$('[data-sublink="facebook"] #f_nav-mini [data-n="'+a[b].uid+'"]'),null!=c&&(!0===a[b].valid?c.addClass("done"):c.remClass("done")));this.nav($('[data-sublink="facebook"] #f_nav-mini [data-n="'+this.selected+'"]'))};
inputFacebookMini.prototype.check=function(a){return a.unknown?!0:""==a.sexe||"."==a.studies||"."==a.age||""==a.loc||""==a.reltype||"10"==a.reltype&&2>a.reltypeSpecial.length?!1:!0};inputFacebookMini.prototype.attach=function(a){console.group("[facebook.mini] attaching events");lsi.createDataset("f_mini-fiches");this.storageToFields();this.handler=a;this.nav_container.addEventListener("click",function(a){this.nav(a.target);this.handler(a.target)}.bind(this),!1);console.groupEnd()}; inputFacebookMini.prototype.check=function(a){return a.unknown?!0:""==a.sexe||"."==a.studies||"."==a.age||""==a.loc||""==a.reltype||"10"==a.reltype&&2>a.reltypeSpecial.length?!1:!0};inputFacebookMini.prototype.attach=function(a){console.group("[facebook.mini] attaching events");lsi.createDataset("f_mini-fiches");this.storageToFields();this.handler=a;this.nav_container.addEventListener("click",function(a){this.nav(a.target);this.handler(a.target)}.bind(this),!1);console.groupEnd()};