$(function(){function e(e,t){var s,a=[];a.push(e.type.toUpperCase()+' url = "'+e.url+'"');for(var r in e.data){if(e.data[r]&&"object"==typeof e.data[r]){s=[];for(var o in e.data[r])s.push(o+': "'+e.data[r][o]+'"');s="{ "+s.join(", ")+" }"}else s='"'+e.data[r]+'"';a.push(r+" = "+s)}a.push("RESPONSE: status = "+t.status),t.responseText&&($.isArray(t.responseText)?(a.push("["),$.each(t.responseText,function(e,t){a.push("{value: "+t.value+', text: "'+t.text+'"}')}),a.push("]")):a.push($.trim(t.responseText))),a.push("--------------------------------------\n"),$("#console").val(a.join("\n")+$("#console").val())}$.mockjaxSettings.responseTime=500,$.mockjax({url:"/post",response:function(t){e(t,this)}}),$.mockjax({url:"/error",status:400,statusText:"Bad Request",response:function(t){this.responseText="Please input correct value",e(t,this)}}),$.mockjax({url:"/status",status:500,response:function(t){this.responseText="Internal Server Error",e(t,this)}}),$.mockjax({url:"/groups",response:function(t){this.responseText=[{value:0,text:"Guest"},{value:1,text:"Service"},{value:2,text:"Customer"},{value:3,text:"Operator"},{value:4,text:"Support"},{value:5,text:"Admin"}],e(t,this)}})});