!7
p {
independentSmartBot();
}
html {
if (eq(uri, "/content")) {
Payload payload = googleVerifyUserToken2(botCompanyGoogleSignInID(), params.get("token"));
if (payload == null)
ret "You are not logged in.";
pnlStruct(payload);
S email = payload.getEmail();
bool again = post(email, "logged in", ".") == null;
if (!payload.getEmailVerified())
ret "Unverified email (huh?)";
bool de = cic((S) payload.get("locale"), "de");
S firstName = (S) payload.get("given_name");
S text = p(htmlencode((de ? "Hallo " : "Hello ")
+ (again ? (de ? "mal wieder, " : "again ") : "")
+ firstName + "!"));
S pic = (S) payload.get("picture");
if (de && isURL(pic))
text += p(htmlencode("Was für ein hübsches Bild:"))
+ p(himg(pic, title := firstName + ", ein toller Mensch"));
ret text;
}
ret hhtml(hhead(htitle("BotCompany.de")
+ loadJQuery()
+ googleSignIn_header()
+ hcss(andrzejButtonStyle())
+ hbody(hfullcenter(
googleSignIn_signInButton(relativeRawBotLink(programID(), "content"), [[
$(".BUTTON_OUT").css('display', 'inline-block');
document.getElementById("content").innerHTML = data;
]], [[
$(".BUTTON_OUT").css('display', 'none');
document.getElementById("content").innerHTML = "";
]])
//+ hsmall(ahref(googleSignIn_signOutURL(), "Sign out"))
+ ahref(googleSignIn_signOutURL(), div("Sign out", class := "BUTTON_OUT", style := "display: none"))
+ "
"
+ div("", id := "content", style := "font-size: 30px")))));
}