Libraryless. Click here for Pure Java version (902L/6K/22K).
!752 static int maxQuestionLength = 500; static int maxAnswerLength = 200; static S html(S subUri, Map<S, S> params) { L history = cast get(getMainBot(), "history"); new StringBuffer buf; buf.append(pageNav(params, litstringlist(), l(history), "n")); pcall { int x = 0; print("l(history)=" + l(history) + ", x=" + x); int n; if (!empty(params.get("n"))) n = parseInt(params.get("n")); else n = max(0, l(history)-1)/100*100; for (int i = min(n+100, l(history))-1; i >= n; i--) { O dialog = history.get(i); S q = shorten(getString(dialog, "question"), maxQuestionLength); S a = shorten(getString(dialog, "answer"), maxAnswerLength); S user = or(getString(dialog, "user"), "User"); buf.append(htag("li", htmlencode(user) + ": <b>" + htmlencode(q) + "</b>", "class", "splash-li") + "\n"); buf.append(htag("li", system() + ": <b>" + htmlencode(a) + "</b>", "class", "splash-li") + "\n"); } } ret htag("p", "n=" + l(history)) + htag("ul", buf); }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment