text: !function(t){t(function(){t("form#test").on("submit",function(e){e.preventDefault();var o=t(this);console.log(o.serializeObject()),t.ajax({type:o.attr("method"),url:o.attr("action"),data:o.serializeObject(),dataType:"json",contentType:"application/x-www-form-urlencoded; charset=UTF-8; X-Requested-With: XMLHttpRequest"}).done(function(e){if(e.hasOwnProperty("data")&&e.data.hasOwnProperty("notify"))for(var o=e.data.notify,n=-1;++n<o.length;)t.notify({message:o[n][0]},{type:o[n][1]});e.hasOwnProperty("code")&&"200"===e.code&&e.hasOwnProperty("redirect")&&setTimeout(function(){location.href=e.redirect},2e3)}).fail(function(){t.notify({message:"Error",url:window.location.protocol+"//"+window.location.host},{type:"danger"})})}),t("a#logout").on("click",function(e){e.preventDefault(),t.ajax({type:"post",url:t(this).attr("href"),dataType:"json",contentType:"application/x-www-form-urlencoded; charset=UTF-8; X-Requested-With: XMLHttpRequest"}).done(function(e){if(e.hasOwnProperty("data")&&e.data.hasOwnProperty("notify"))for(var o=e.data.notify,n=-1;++n<o.length;)t.notify({message:o[n][0]},{type:o[n][1]});e.hasOwnProperty("code")&&"200"===e.code&&e.hasOwnProperty("redirect")&&setTimeout(function(){location.href=e.redirect},2e3)}).fail(function(){t.notify({message:"Error",url:window.location.protocol+"//"+window.location.host},{type:"danger"})})})})}(jQuery);