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

5 lines
1.3 KiB
JavaScript
Raw Normal View History

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