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:".",interest:".",relmark:".",job:".",famsit:"0",studies:".",reltype:"0",reltypeSpecial:"",city:"",quartier:"",cp:"",loc:"0",duration:["",""],context:"0",contextSpecial:["","",""],freq:["3","8","13","18","23"],irlfreq:["3","8","13","18","23"],connect:"1 3 5 7 9 11".split(" "),connectSpecial:["",""],medsoc:"0",medrel:"0",timestamp:0,valid:!1}}; inputFacebookFiche.prototype.fieldsToStorage=function(){console.group("[facebook.fiche] fields to storage");var a,b,c,d,e,h=$$('[data-sublink="facebook"] article.relation-panel .fiche-relation');a=0;for(b=h.length;a FICHE UPDATE ("+(d.timestamp-input_ts)+")"),lsi.set("f_fiches",d.uid,d));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; 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.interest=null!=a.interest?a.interest:this.defaultData.interest;a.relmark=null!=a.relmark?a.relmark:this.defaultData.relmark;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.medsoc=null!=a.medsoc?a.medsoc:this.defaultData.medsoc;a.medrel=null!=a.medrel?a.medrel:this.defaultData.medrel;a.freq=null!=a.freq?a.freq:this.defaultData.freq;a.irlfreq=null!=a.irlfreq?a.irlfreq:this.defaultData.irlfreq;a.connect=null!=a.connect?a.connect: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.interest=c.interest,a.relmark=c.relmark,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.medsoc=c.medsoc,a.medrel=c.medrel,a.contextSpecial=c.contextExtra,a.connect=c.connect,a.connectSpecial=c.connectExtra,a.freq=c.freq,a.irlfreq=c.irlfreq,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]}); 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");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");b=$('[data-sublink="facebook"] article.fiche-relation input[data-name="uid"][value="'+a.uid+'"] ~ h5>span>select[data-name="interest"]>option[value="'+a.interest+'"]');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="relmark"]>option[value="'+a.relmark+'"]');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;binput[type="radio"][data-name="famsit"]');for(b=0;binput[type="radio"][data-name="reltype"]');for(b=0;binput[type="radio"][data-name="loc"]');for(b=0;binput[type="radio"][data-name="context"]');for(b=0;binput[type="radio"][data-name="medsoc"]');for(b=0;binput[type="radio"][data-name="medrel"]');for(b=0;binput[type="radio"][data-name="freq"]');for(b=0;binput[type="radio"][data-name="irlfreq"]');for(b=0;binput[type="radio"][data-name="connect"]');for(b=0;b span.active'),c=0;cHISTORIQUE");20>d&&c'+(d%20+1)+"  ":(20==d&&(this.nav_container.innerHTML+='
MESSENGER '),this.nav_container.innerHTML+=''+(d%20+1)+"")}for(var e in a)b=$('[data-sublink="facebook"] #f_nav-fiche [data-n="'+a[e].uid+'"]'),null!=b&&(!0===a[e].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]))&&0a.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()};