+void tmpl_vcard_put_bgcolor(StrBuf *Target, WCTemplputParams *TP)
+{
+ struct vnote *v = (struct vnote *) CTX;
+ StrBufAppendPrintf(Target, "%02X%02X%02X", v->color_red/2, v->color_green/2, v->color_blue/2);
+}
+
+void tmpl_vcard_put_message(StrBuf *Target, WCTemplputParams *TP)
+{
+ struct vnote *v = (struct vnote *) CTX;
+ StrEscAppend(Target, NULL, v->body, 0, 0); /*TODO?*/
+}
+
+void tmpl_vcard_put_uid(StrBuf *Target, WCTemplputParams *TP)
+{
+ struct vnote *v = (struct vnote *) CTX;
+ StrBufAppendBufPlain(Target, v->uid, -1, 0);
+}
+
+
+
+
+int notes_GetParamsGetServerCall(SharedMessageStatus *Stat,
+ void **ViewSpecific,
+ long oper,
+ char *cmd,
+ long len,
+ char *filter,
+ long flen)
+{
+ strcpy(cmd, "MSGS ALL");
+ Stat->maxmsgs = 32767;
+ wc_printf("<div id=\"new_notes_here\"></div>\n");
+ return 200;
+
+}
+
+int notes_Cleanup(void **ViewSpecific)
+{
+ wDumpContent(1);
+ return 0;
+}
+
+
+void
+InitModule_NOTES
+(void)
+{
+ RegisterReadLoopHandlerset(
+ VIEW_NOTES,
+ notes_GetParamsGetServerCall,
+ NULL,
+ NULL,
+ NULL,
+ notes_LoadMsgFromServer,
+ NULL,
+ notes_Cleanup);
+
+ WebcitAddUrlHandler(HKEY("add_new_note"), "", 0, add_new_note, 0);
+ WebcitAddUrlHandler(HKEY("ajax_update_note"), "", 0, ajax_update_note, 0);
+
+ RegisterNamespace("VNOTE:POS:LEFT", 0, 0, tmpl_vcard_put_posleft, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:POS:TOP", 0, 0, tmpl_vcard_put_postop, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:POS:WIDTH", 0, 0, tmpl_vcard_put_poswidth, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:POS:HEIGHT", 0, 0, tmpl_vcard_put_posheight, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:POS:HEIGHT2", 0, 0, tmpl_vcard_put_posheight2, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:POS:WIDTH2", 0, 0, tmpl_vcard_put_width2, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:COLOR", 0, 0, tmpl_vcard_put_color, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:BGCOLOR", 0, 0,tmpl_vcard_put_bgcolor, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:MSG", 0, 1, tmpl_vcard_put_message, NULL, CTX_VNOTE);
+ RegisterNamespace("VNOTE:UID", 0, 0, tmpl_vcard_put_uid, NULL, CTX_VNOTE);
+}