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

4 lines
1.0 KiB
JavaScript
Raw Normal View History

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