!7 static S text; concept Text { S conceptID; S text; S by; } p { db(); load("text"); if (isMainProgram()) serveHttpAndOpenBrowser(); } synchronized html { S newText = params.get("text"); if (newText != null) { text = newText; save("text"); } S user = cast call(getBot(#1007510), "conceptIDForCookie"); S msg = ""; if (nempty(params.get("publish"))) { Text t = uniq_sync(Text, conceptID := aGlobalID(), text := text, by := user); msg = "Published as: " + t.conceptID; } ret (empty(msg) ? "" : p(msg)) + p("You are: " + or2(user, "?")) + hpostform([[
#TEXT#


]].replace("#TEXT#", htmlencode(text)), onSubmit := "if (editor) text.value = editor.getValue(); return true;"); }