Warning: session_start(): open(/var/lib/php/sessions/sess_a1ur32pia5eepgsdiusfvt19sc, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!7
class Msg {
S author, text;
}
concept ItemPage {
S globalID = aGlobalID();
S title, imageID;
long created = now(), occurred;
L comments = listInConcept(this);
}
static JTextPane textPane;
p-subst {
setConsoleInputFontSize(20);
centerConsoleInput();
centerBottomConsole();
db();
bot("Show Item Page.");
focusConsole();
}
static bool showItemPage(S _word) {
final new ItemPage p;
fS word = trim(_word);
cset(p, title := word);
showPage(p);
true;
}
svoid showPage(final ItemPage p) {
swing {
fS shorter = deUserSaid(p.title);
JFrame f = getFrame(textPane);
fS text = word + "\n\n";
frameToFront(showFrame(shorter, textPane = jcenteredtextpane(text, style_bold(style_fontSize(24))), f));
textPane.setEditable(false);
focusConsole();
if (p.imageID == null) thread {
BufferedImage img = quickVisualize(shorter);
cset(p, imageID := "quickvis/" + urlencode(quickVisualize_preprocess(shorter)) + "/" + md5OfBufferedImage(img));
showPage(p);
} else {
BufferedImage img = quickVisualize(shorter);
addImageToTextPane(textPane, img);
}
for (Msg c : p.comments)
appendToTextPane(textPane, "\n\n" + c.author + ": " + c.text);
}
true;
}
answer {
if (showItemPage(s)) ret "OK";
}