Seditio Source
Root |
./othercms/xenForo 2.2.8/js/xf/form_fill.min.js
'use strict';!function(d,f,g,h){XF.FormFill=XF.Element.newHandler({options:{fillers:".js-FormFiller",key:"fill",action:null},xhr:null,init:function(){if(this.$target.is("form"))if(this.options.action||(this.options.action=this.$target.attr("action")),this.options.action)this.$target.on("click",this.options.fillers,XF.proxy(this,"change"));else console.error("Form filler requires an action option or attribute");else console.error("Target must be a form")},change:function(){this.xhr&&this.xhr.abort();
this.xhr=XF.ajax("post",this.options.action,this.$target.serialize()+"&"+this.options.key+"=1",XF.proxy(this,"onSuccess"))},onSuccess:function(c){if(c.formValues){var e=this.$target;d.each(c.formValues,function(a,b){a=e.find(a);a.length&&(a.is(":checkbox, :radio")?(a.prop("checked",b?!0:!1).triggerHandler("click",{triggered:!0}),b?a.trigger("control:enabled"):a.trigger("control:disabled")):a.is("select, input, textarea")&&(a.val(b),a.is("textarea")&&(b=XF.Element.getHandler(a,"textarea-handler"))&&
b.update()))})}}});XF.Element.register("form-fill","XF.FormFill")}(jQuery,window,document);