function parseHtml(a,b,c,n,k){k=void 0===k?!1:k;for(var l="",f,m=0;m'+('')+"",$(c).html(b));getJSONCDS(a+"?limit="+l+"&page="+k+"&keyword="+f+d).done(function(a){$(c).html(parseHtml(n,l,a,m))})} function multiPageHelper(a,b,c,n,k,l,f,m,d,g,e){e=void 0===e?"":e;""!==c&&(c='
'+('')+"
",$(n).html(c));$(k).html("");getJSONCDS(b+"?limit="+m+"&page="+f+"&keyword="+d+e).done(function(e){var b=!1,c="",d=e.pageCount,m=e.pageResults,h=f+1,q=f-1;var r=f+3;h>d&&(h=d);0==q&&(q=1);1d?(b=1,r=d):q==f-1?(b=f>=d-2?d-3:f-1,--r):b=f;c+=''; c+='';for(i=b;i<=r;i++)i<=d&&(c+='");c+='';c+=''}$(n).html(parseHtml(l,m,e,g));$(k).html(c)})} var Comments=function(a,b,c,n,k,l,f,m,d){this.assetid=a;this.commentsid=b;this.commentscontainer=c;this.buttonscontainer=n;this.successid=k;this.errorid=l;this.inputid=f;this.messageDelay=m;this.newObject=d;var g=this;getJSONCDS("https://api.alphaland.cc/game/info?id="+this.assetid).done(function(a){a.CommentsEnabled&&($(g.commentsid).show(),g.commentsPage())})}; Comments.prototype.commentsPage=function(a){multiPageHelper(this.newObject+".commentsPage","https://api.alphaland.cc/comments/","https://api.alphaland.cc/logo",this.commentscontainer,this.buttonscontainer,'
Comment by {username} : {date}

{comment}

', void 0===a?1:a,10,"","No comments","&assetId="+this.assetid)};Comments.prototype.submitComment=function(a){var b=this;postJSONCDS("https://api.alphaland.cc/comments/newcomment?assetId="+this.assetid,JSON.stringify({comment:a})).done(function(a){a=a.alert;var c=b.errorid;"Comment Placed"==a&&(c=b.successid,$(b.inputid).val(""),b.commentsPage());$(c).text(a);$(c).show();window.scrollTo({top:0,behavior:"smooth"});setTimeout(function(){$(c).hide()},b.messageDelay)})};