Correction du pb de saisie après avoir `Tout effacer` le formulaire
This commit is contained in:
parent
05efdedd02
commit
83e7e18600
|
@ -60,7 +60,7 @@ inputFacebookFiche.prototype.fieldsToStorage = function(){
|
||||||
existingData = lsi.get('f_fiches', deflated.uid);
|
existingData = lsi.get('f_fiches', deflated.uid);
|
||||||
|
|
||||||
// Si erreur, on passe à la fiche suivante
|
// Si erreur, on passe à la fiche suivante
|
||||||
if( existingData === false )
|
if( !existingData )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ inputFacebookFiche.prototype.fieldsToStorage = function(){
|
||||||
hash = crc32( JSON.stringify(obj) );
|
hash = crc32( JSON.stringify(obj) );
|
||||||
|
|
||||||
// {5.2} Si le hash est identique, on ne fait rien //
|
// {5.2} Si le hash est identique, on ne fait rien //
|
||||||
if( existingData['hash'] != undefined && hash == existingData.hash )
|
if( existingData.hasOwnProperty('hash') && hash == existingData.hash )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// {5.3} On enregistre le hash //
|
// {5.3} On enregistre le hash //
|
||||||
|
|
|
@ -50,7 +50,7 @@ inputFacebookMini.prototype.fieldsToStorage = function(){
|
||||||
existingData = lsi.get('f_mini-fiches', deflated.uid);
|
existingData = lsi.get('f_mini-fiches', deflated.uid);
|
||||||
|
|
||||||
// Si erreur, on passe à la fiche suivante
|
// Si erreur, on passe à la fiche suivante
|
||||||
if( existingData === false )
|
if( !existingData )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* (4) On récupère et met en forme les valeurs du deflater */
|
/* (4) On récupère et met en forme les valeurs du deflater */
|
||||||
|
@ -72,7 +72,7 @@ inputFacebookMini.prototype.fieldsToStorage = function(){
|
||||||
hash = crc32( JSON.stringify(obj) );
|
hash = crc32( JSON.stringify(obj) );
|
||||||
|
|
||||||
// {5.2} Si le hash est identique, on ne fait rien //
|
// {5.2} Si le hash est identique, on ne fait rien //
|
||||||
if( existingData['hash'] != undefined && hash == existingData.hash )
|
if( existingData.hasOwnProperty('hash') && hash == existingData.hash )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// {5.3} On enregistre le hash //
|
// {5.3} On enregistre le hash //
|
||||||
|
|
|
@ -59,7 +59,7 @@ inputPhoneFiche.prototype.fieldsToStorage = function(){
|
||||||
existingData = lsi.get('p_fiches', deflated.uid);
|
existingData = lsi.get('p_fiches', deflated.uid);
|
||||||
|
|
||||||
// Si erreur, on passe à la fiche suivante
|
// Si erreur, on passe à la fiche suivante
|
||||||
if( existingData === false )
|
if( !existingData )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ inputPhoneFiche.prototype.fieldsToStorage = function(){
|
||||||
hash = crc32( JSON.stringify(obj) );
|
hash = crc32( JSON.stringify(obj) );
|
||||||
|
|
||||||
// {5.2} Si le hash est identique, on ne fait rien //
|
// {5.2} Si le hash est identique, on ne fait rien //
|
||||||
if( existingData['hash'] != undefined && hash == existingData.hash )
|
if( existingData.hasOwnProperty('hash') && hash == existingData.hash )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// {5.3} On enregistre le hash //
|
// {5.3} On enregistre le hash //
|
||||||
|
|
|
@ -50,7 +50,7 @@ inputPhoneMini.prototype.fieldsToStorage = function(){
|
||||||
existingData = lsi.get('p_mini-fiches', deflated.uid);
|
existingData = lsi.get('p_mini-fiches', deflated.uid);
|
||||||
|
|
||||||
// Si erreur, on passe à la fiche suivante
|
// Si erreur, on passe à la fiche suivante
|
||||||
if( existingData === false )
|
if( !existingData )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* (4) On récupère et met en forme les valeurs du deflater */
|
/* (4) On récupère et met en forme les valeurs du deflater */
|
||||||
|
@ -72,7 +72,7 @@ inputPhoneMini.prototype.fieldsToStorage = function(){
|
||||||
hash = crc32( JSON.stringify(obj) );
|
hash = crc32( JSON.stringify(obj) );
|
||||||
|
|
||||||
// {5.2} Si le hash est identique, on ne fait rien //
|
// {5.2} Si le hash est identique, on ne fait rien //
|
||||||
if( existingData['hash'] != undefined && hash == existingData.hash )
|
if( existingData.hasOwnProperty('hash') && hash == existingData.hash )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// {5.3} On enregistre le hash //
|
// {5.3} On enregistre le hash //
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
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}};
|
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");var a,b,c,e,d,h=$$('[data-sublink="facebook"] article.relation-panel .fiche-relation');a=0;for(b=h.length;a<b;a++)if(c=new FormDeflater(h[a],["input","select"],["data-name"]),e=c.deflate(),c=lsi.get("f_fiches",e.uid),!1!==c&&(e={sexe:e.sexe,age:e.age,job:e.job,famsit:e.famsit,studies:e.studies,reltype:e.reltype,reltypeSpecial:e.reltypeSpecial,city:e.city,quartier:e.quartier,cp:e.cp,loc:e.loc,
|
inputFacebookFiche.prototype.fieldsToStorage=function(){console.group("[facebook.fiche] fields to storage");var a,b,c,e,d,h=$$('[data-sublink="facebook"] article.relation-panel .fiche-relation');a=0;for(b=h.length;a<b;a++)if(c=new FormDeflater(h[a],["input","select"],["data-name"]),e=c.deflate(),c=lsi.get("f_fiches",e.uid))e={sexe:e.sexe,age:e.age,job:e.job,famsit:e.famsit,studies:e.studies,reltype:e.reltype,reltypeSpecial:e.reltypeSpecial,city:e.city,quartier:e.quartier,cp:e.cp,loc:e.loc,duration:e.duration,
|
||||||
duration:e.duration,context:e.context,contextSpecial:e.contextSpecial,freq:e.freq,connect:e.connect,connectSpecial:e.connectSpecial,uid:parseInt(e.uid),contact:parseInt(e.contact)},d=crc32(JSON.stringify(e)),void 0==c.hash||d!=c.hash))e.hash=d,e.valid=this.check(e),e.timestamp=Date.now(),console.warn("> FICHE UPDATE ("+(e.timestamp-input_ts)+")"),lsi.set("f_fiches",e.uid,e);console.groupEnd()};
|
context:e.context,contextSpecial:e.contextSpecial,freq:e.freq,connect:e.connect,connectSpecial:e.connectSpecial,uid:parseInt(e.uid),contact:parseInt(e.contact)},d=crc32(JSON.stringify(e)),c.hasOwnProperty("hash")&&d==c.hash||(e.hash=d,e.valid=this.check(e),e.timestamp=Date.now(),console.warn("> FICHE UPDATE ("+(e.timestamp-input_ts)+")"),lsi.set("f_fiches",e.uid,e));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:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function inputFacebookMini(a,b){this.container=a;this.nav_container=b}inputFacebookMini.prototype={container:this.container,nav_container:this.nav_container,selected:null,handler:null,defaultData:{contact:null,sexe:"2",age:".",studies:"0",loc:".",reltype:"9",reltypeSpecial:"",unknown:!1,timestamp:0,valid:!1}};
|
function inputFacebookMini(a,b){this.container=a;this.nav_container=b}inputFacebookMini.prototype={container:this.container,nav_container:this.nav_container,selected:null,handler:null,defaultData:{contact:null,sexe:"2",age:".",studies:"0",loc:".",reltype:"9",reltypeSpecial:"",unknown:!1,timestamp:0,valid:!1}};
|
||||||
inputFacebookMini.prototype.fieldsToStorage=function(){console.group("[facebook.mini] fields to storage");var a,b,c,d,e,f=$$('[data-sublink="facebook"] article.mini-relation-panel .mini-fiche-relation');a=0;for(b=f.length;a<b;a++)if(c=new FormDeflater(f[a],["input","select"],["data-name"]),d=c.deflate(),c=lsi.get("f_mini-fiches",d.uid),!1!==c&&(d={contact:parseInt(d.uid),sexe:d.sexe,age:d.age,studies:d.studies,loc:d.loc,reltype:d.reltype,reltypeSpecial:d.reltypeSpecial,unknown:null!=d.unknown,uid:parseInt(d.uid)},
|
inputFacebookMini.prototype.fieldsToStorage=function(){console.group("[facebook.mini] fields to storage");var a,b,c,d,e,f=$$('[data-sublink="facebook"] article.mini-relation-panel .mini-fiche-relation');a=0;for(b=f.length;a<b;a++)if(c=new FormDeflater(f[a],["input","select"],["data-name"]),d=c.deflate(),c=lsi.get("f_mini-fiches",d.uid))d={contact:parseInt(d.uid),sexe:d.sexe,age:d.age,studies:d.studies,loc:d.loc,reltype:d.reltype,reltypeSpecial:d.reltypeSpecial,unknown:null!=d.unknown,uid:parseInt(d.uid)},
|
||||||
e=crc32(JSON.stringify(d)),void 0==c.hash||e!=c.hash))d.hash=e,d.valid=this.check(d),d.timestamp=Date.now(),console.warn("> MINI UPDATE ("+(d.timestamp-input_ts)+")"),lsi.set("f_mini-fiches",d.uid,d);console.groupEnd()};
|
e=crc32(JSON.stringify(d)),c.hasOwnProperty("hash")&&e==c.hash||(d.hash=e,d.valid=this.check(d),d.timestamp=Date.now(),console.warn("> MINI UPDATE ("+(d.timestamp-input_ts)+")"),lsi.set("f_mini-fiches",d.uid,d));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 b=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 b=lsi.get("f_contacts",
|
||||||
a.uid);if(!1===b)return!1;if(!isNaN(b.existing)){var c=lsi.get("f_friends",b.existing);b.username=c.name;a.contact=c.contact;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.studies1&&(a.studies=c.studies1)}this.container.innerHTML+=fMiniFicheBuilder.build({name:b.username,uid:a.uid,reltypespecial:a.reltypeSpecial});b=$('[data-sublink="facebook"] article.mini-fiche-relation input[data-name="uid"][value="'+
|
a.uid);if(!1===b)return!1;if(!isNaN(b.existing)){var c=lsi.get("f_friends",b.existing);b.username=c.name;a.contact=c.contact;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.studies1&&(a.studies=c.studies1)}this.container.innerHTML+=fMiniFicheBuilder.build({name:b.username,uid:a.uid,reltypespecial:a.reltypeSpecial});b=$('[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!=b&&b.setAttribute("selected","selected");b=$('[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!=b&&b.setAttribute("selected","selected");c=$$('[data-sublink="facebook"] article.mini-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.uid+'"] ~ h5>span>select[data-name="studies"]>option[value="'+a.studies+'"]');null!=b&&b.setAttribute("selected","selected");b=$('[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!=b&&b.setAttribute("selected","selected");c=$$('[data-sublink="facebook"] article.mini-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==
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function inputPhoneFiche(a,b){this.container=a;this.nav_container=b;this.top_size=10}inputPhoneFiche.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 inputPhoneFiche(a,b){this.container=a;this.nav_container=b;this.top_size=10}inputPhoneFiche.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}};
|
||||||
inputPhoneFiche.prototype.fieldsToStorage=function(){console.group("[phone.fiche] fields to storage");var a,b,c,e,d,h=$$('[data-sublink="phone"] article.relation-panel .fiche-relation');a=0;for(b=h.length;a<b;a++)if(c=new FormDeflater(h[a],["input","select"],["data-name"]),e=c.deflate(),c=lsi.get("p_fiches",e.uid),!1!==c&&(e={sexe:e.sexe,age:e.age,job:e.job,famsit:e.famsit,studies:e.studies,reltype:e.reltype,reltypeSpecial:e.reltypeSpecial,city:e.city,quartier:e.quartier,cp:e.cp,loc:e.loc,duration:e.duration,
|
inputPhoneFiche.prototype.fieldsToStorage=function(){console.group("[phone.fiche] fields to storage");var a,b,c,e,d,h=$$('[data-sublink="phone"] article.relation-panel .fiche-relation');a=0;for(b=h.length;a<b;a++)if(c=new FormDeflater(h[a],["input","select"],["data-name"]),e=c.deflate(),c=lsi.get("p_fiches",e.uid))e={sexe:e.sexe,age:e.age,job:e.job,famsit:e.famsit,studies:e.studies,reltype:e.reltype,reltypeSpecial:e.reltypeSpecial,city:e.city,quartier:e.quartier,cp:e.cp,loc:e.loc,duration:e.duration,
|
||||||
context:e.context,contextSpecial:e.contextSpecial,freq:e.freq,connect:e.connect,connectSpecial:e.connectSpecial,uid:parseInt(e.uid),contact:parseInt(e.contact)},d=crc32(JSON.stringify(e)),void 0==c.hash||d!=c.hash))e.hash=d,e.valid=this.check(e),e.timestamp=Date.now(),console.warn("> FICHE UPDATE ("+(e.timestamp-input_ts)+")"),lsi.set("p_fiches",e.uid,e);console.groupEnd()};
|
context:e.context,contextSpecial:e.contextSpecial,freq:e.freq,connect:e.connect,connectSpecial:e.connectSpecial,uid:parseInt(e.uid),contact:parseInt(e.contact)},d=crc32(JSON.stringify(e)),c.hasOwnProperty("hash")&&d==c.hash||(e.hash=d,e.valid=this.check(e),e.timestamp=Date.now(),console.warn("> FICHE UPDATE ("+(e.timestamp-input_ts)+")"),lsi.set("p_fiches",e.uid,e));console.groupEnd()};
|
||||||
inputPhoneFiche.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;
|
inputPhoneFiche.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:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
function inputPhoneMini(a,b){this.container=a;this.nav_container=b}inputPhoneMini.prototype={container:this.container,nav_container:this.nav_container,selected:null,handler:null,defaultData:{contact:null,sexe:"2",age:".",studies:"0",loc:".",reltype:"9",reltypeSpecial:"",unknown:!1,timestamp:0,valid:!1}};
|
function inputPhoneMini(a,b){this.container=a;this.nav_container=b}inputPhoneMini.prototype={container:this.container,nav_container:this.nav_container,selected:null,handler:null,defaultData:{contact:null,sexe:"2",age:".",studies:"0",loc:".",reltype:"9",reltypeSpecial:"",unknown:!1,timestamp:0,valid:!1}};
|
||||||
inputPhoneMini.prototype.fieldsToStorage=function(){console.group("[phone.mini] fields to storage");var a,b,c,d,e,f=$$('[data-sublink="phone"] article.mini-relation-panel .mini-fiche-relation');a=0;for(b=f.length;a<b;a++)if(c=new FormDeflater(f[a],["input","select"],["data-name"]),d=c.deflate(),c=lsi.get("p_mini-fiches",d.uid),!1!==c&&(d={contact:parseInt(d.uid),sexe:d.sexe,age:d.age,studies:d.studies,loc:d.loc,reltype:d.reltype,reltypeSpecial:d.reltypeSpecial,unknown:null!=d.unknown,uid:parseInt(d.uid)},
|
inputPhoneMini.prototype.fieldsToStorage=function(){console.group("[phone.mini] fields to storage");var a,b,c,d,e,f=$$('[data-sublink="phone"] article.mini-relation-panel .mini-fiche-relation');a=0;for(b=f.length;a<b;a++)if(c=new FormDeflater(f[a],["input","select"],["data-name"]),d=c.deflate(),c=lsi.get("p_mini-fiches",d.uid))d={contact:parseInt(d.uid),sexe:d.sexe,age:d.age,studies:d.studies,loc:d.loc,reltype:d.reltype,reltypeSpecial:d.reltypeSpecial,unknown:null!=d.unknown,uid:parseInt(d.uid)},
|
||||||
e=crc32(JSON.stringify(d)),void 0==c.hash||e!=c.hash))d.hash=e,d.valid=this.check(d),d.timestamp=Date.now(),console.warn("> MINI UPDATE ("+(d.timestamp-input_ts)+")"),lsi.set("p_mini-fiches",d.uid,d);console.groupEnd()};
|
e=crc32(JSON.stringify(d)),c.hasOwnProperty("hash")&&e==c.hash||(d.hash=e,d.valid=this.check(d),d.timestamp=Date.now(),console.warn("> MINI UPDATE ("+(d.timestamp-input_ts)+")"),lsi.set("p_mini-fiches",d.uid,d));console.groupEnd()};
|
||||||
inputPhoneMini.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 b=lsi.get("p_contacts",
|
inputPhoneMini.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 b=lsi.get("p_contacts",
|
||||||
a.uid);if(!1===b)return!1;if(!isNaN(b.existing)){var c=lsi.get("p_friends",b.existing);b.username=c.name;a.contact=b.uid;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.studies1&&(a.studies=c.studies1)}this.container.innerHTML+=pMiniFicheBuilder.build({name:b.username,countcall:b.countcall,countsms:b.countsms,uid:a.uid,reltypespecial:a.reltypeSpecial});b=$('[data-sublink="phone"] article.mini-fiche-relation input[data-name="uid"][value="'+
|
a.uid);if(!1===b)return!1;if(!isNaN(b.existing)){var c=lsi.get("p_friends",b.existing);b.username=c.name;a.contact=b.uid;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.studies1&&(a.studies=c.studies1)}this.container.innerHTML+=pMiniFicheBuilder.build({name:b.username,countcall:b.countcall,countsms:b.countsms,uid:a.uid,reltypespecial:a.reltypeSpecial});b=$('[data-sublink="phone"] 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=$('[data-sublink="phone"] 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");c=$$('[data-sublink="phone"] article.mini-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.uid+'"] ~ h5>span>select[data-name="studies"]>option[value="'+a.studies+'"]');null!=b&&b.setAttribute("selected","selected");b=$('[data-sublink="phone"] 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");c=$$('[data-sublink="phone"] article.mini-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==
|
||||||
|
|
Loading…
Reference in New Issue