NxTIC/js/includes/input-phone-subject-min.js

5 lines
1.5 KiB
JavaScript

function inputPhoneSubject(a,b,c,d,e,f){this.tmp_id=a;this.number=b;this.username=c;this.firstname=d;this.lastname=e;this.store_button=f}inputPhoneSubject.prototype={store_button:this.store_button,tmp_id:this.tmp_id,number:this.number,username:this.username,firstname:this.firstname,lastname:this.lastname};inputPhoneSubject.prototype.check=function(){var a=0<this.number.value.length;return a=a&&0<this.username.value.length+this.firstname.value.length+this.lastname.value.length};
inputPhoneSubject.prototype.fieldsToStorage=function(){console.log("SUBJECT: FIELDS TO STORAGE");if(!this.check())return!1;lsi.set("p_subject",0,{tmp_id:this.tmp_id.value,number:this.number.value,username:this.username.value,firstname:this.firstname.value,lastname:this.lastname.value})};
inputPhoneSubject.prototype.storageToFields=function(){console.log("SUBJECT: STORAGE TO FIELDS");var a=lsi.get("p_subject",0);null==a&&(a={tmp_id:"",number:"",username:"",firstname:"",lastname:""});this.tmp_id.value=a.tmp_id;this.number.value=a.number;this.username.value=a.username;this.firstname.value=a.firstname;this.lastname.value=a.lastname};
inputPhoneSubject.prototype.attach=function(){function a(a){b.fieldsToStorage()&&b.storageToFields()}console.log("SUBJECT: ATTACH");lsi.createDataset("p_subject");var b=this;this.store_button.addEventListener("click",a,!1);this.number.addEventListener("blur",a,!1);this.username.addEventListener("blur",a,!1);this.firstname.addEventListener("blur",a,!1);this.lastname.addEventListener("blur",a,!1);this.storageToFields()};