|
|
@@ -91,7 +91,8 @@ c.open("GET",a,!0);c.send(null)}function e(){var a=h.createLinearGradient(0,0,0,
|
|
|
y[b]=[f];for(var k in d)d[k].Ja||d[k].$a||h.push({src:"api/avatar?user="+d[k].id});c(h,function(c){a(g,c);x[b]=m.toDataURL();y[b].forEach(function(a){a(x[b])})})}}}();var X=0,M=null,P=null,T=null,V=null;function lb(){var a=new XMLHttpRequest;a.timeout=6E4;a.onreadystatechange=function(){if(4===a.readyState){var b=document.createElement("script"),c=document.createElement("link");b.innerHTML=a.response;b.language="text/javascript";c.href="hljs-androidstudio.css";c.rel="stylesheet";document.head.appendChild(c);document.body.appendChild(b)}};a.open("GET","highlight.pack.js",!0);a.send(null)}
|
|
|
function Gb(){var a=M,b=new XMLHttpRequest;b.open("GET","api/hist?room="+a.id,!0);b.onreadystatechange=function(){if(4===b.readyState&&b.response){var c=b.response;try{c=JSON.parse(c)}catch(e){}var d=E.a[a.id];d?d=!!la(d,c,Date.now()):(E.a[a.id]=new Y(a,100,c,Date.now()),d=!0);d&&(Bb(H(E.context,a.id),a,c),a===M&&Q())}};b.send(null)}
|
|
|
function Hb(a){var b=new XMLHttpRequest;b.timeout=6E4;b.onreadystatechange=function(){if(4===b.readyState)if(b.status){var c=null,d=2===Math.floor(b.status/100);if(d){X&&(X=0,Ya(!0));c=b.response;try{c=JSON.parse(c)}catch(e){c=null}}else X?(X+=Math.floor((X||5)/2),X=Math.min(60,X)):(X=5,Ya(!1));a(d,c)}else X&&(X=0,Ya(!0)),Hb(a)};b.open("GET","api?v="+E.b,!0);b.send(null)}function pb(){var a=new XMLHttpRequest;a.open("POST","api/typing?room="+M.id,!0);a.send(null)}
|
|
|
-function Ib(a,b){a?(b&&E.update(b),tb()):setTimeout(tb,1E3*X)}function tb(){Hb(Ib)}function kb(a){M&&document.getElementById("room_"+M.id).classList.remove("selected");document.getElementById("room_"+a.id).classList.add("selected");document.body.classList.remove("no-room-selected");M=a;P=H(E.context,a.id);Za();Ua(P.a.id,P.m,function(a){document.getElementById("chatCtx").style.backgroundImage="url("+a+")"});(!E.a[M.id]||100>E.a[M.id].a.length)&&Gb()}
|
|
|
+function Ib(a,b){a?(b&&E.update(b),tb()):setTimeout(tb,1E3*X)}function tb(){Hb(Ib)}
|
|
|
+function kb(a){M&&(document.getElementById("room_"+M.id).classList.remove("selected"),document.getElementById("chatSystemContainer").classList.add("no-room-selected"));document.getElementById("room_"+a.id).classList.add("selected");document.body.classList.remove("no-room-selected");M=a;P=H(E.context,a.id);Za();Ua(P.a.id,P.m,function(a){document.getElementById("chatCtx").style.backgroundImage="url("+a+")"});(!E.a[M.id]||100>E.a[M.id].a.length)&&Gb();document.getElementById("chatSystemContainer").classList.remove("no-room-selected")}
|
|
|
function nb(a,b,c){var d=M;new FileReader;var e=new FormData,f=new XMLHttpRequest;e.append("file",b);e.append("filename",a);f.onreadystatechange=function(){4===f.readyState&&(204===f.status?c(null):c(f.statusText))};f.open("POST","api/file?room="+d.id);f.send(e)}
|
|
|
function Jb(a,b,c){var d=new XMLHttpRequest;b="api/msg?room="+a.id+"&text="+encodeURIComponent(b);c&&(b+="&attachments="+encodeURIComponent(JSON.stringify([{fallback:c.text,author_name:I(c.J).name,text:c.text,footer:a.b?K.message:a.name,ts:c.l}])));d.open("POST",b,!0);d.send(null)}
|
|
|
function ob(a){if(V){var b=new XMLHttpRequest;b.open("PUT","api/msg?room="+M.id+"&ts="+V.id+"&text="+encodeURIComponent(a),!0);b.send(null);return!0}if("/"===a[0]){var c=a.indexOf(" "),b=a.substr(0,-1===c?void 0:c);a=-1===c?"":a.substr(c);var c=P,d=qb.La(b);return d?(d.exec(c,M,a.trim()),!0):c&&(b=c.i.data[b])?(c=new XMLHttpRequest,c.open("POST","api/cmd?room="+M.id+"&cmd="+encodeURIComponent(b.name.substr(1))+"&args="+encodeURIComponent(a.trim()),!0),c.send(null),!0):!1}Jb(M,a,T);return!0}
|