From 9f86bcfb5f58af7d3d9378583ba493f125c530b0 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Sun, 13 Dec 2015 19:24:42 +0100 Subject: [PATCH] add preference whether the user prefers to send markdown messages. --- webcit/messages.c | 8 ++++- webcit/static/t/prefs/box.html | 40 +++++++++++++--------- webcit/static/t/view_blog/comment_box.html | 1 + 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/webcit/messages.c b/webcit/messages.c index 7ac906d62..3c3c92f6d 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1366,6 +1366,10 @@ void display_enter(void) int i = 0; long replying_to; + int prefer_md; + + get_pref_yesno("markdown", &prefer_md, 0); + if (havebstr("force_room")) { gotoroom(sbstr("force_room")); } @@ -1695,7 +1699,7 @@ void display_enter(void) begin_burst(); output_headers(1, 0, 0, 0, 1, 0); - if (WCC->CurRoom.defview == VIEW_WIKIMD) + if ((WCC->CurRoom.defview == VIEW_WIKIMD) || prefer_md) DoTemplate(HKEY("edit_markdown_epic"), NULL, &NoCtx); else DoTemplate(HKEY("edit_message"), NULL, &NoCtx); @@ -2056,6 +2060,8 @@ InitModule_MSG PRF_STRING, NULL); RegisterPreference("mailbox",_("Mailbox view mode"), PRF_STRING, NULL); + RegisterPreference("markdown",_("Prefer markdown editing"), PRF_YESNO, NULL); + WebcitAddUrlHandler(HKEY("readnew"), "", 0, h_readnew, ANONYMOUS|NEED_URL); WebcitAddUrlHandler(HKEY("readold"), "", 0, h_readold, ANONYMOUS|NEED_URL); diff --git a/webcit/static/t/prefs/box.html b/webcit/static/t/prefs/box.html index ae7f1eb82..bb8758ef4 100644 --- a/webcit/static/t/prefs/box.html +++ b/webcit/static/t/prefs/box.html @@ -6,9 +6,9 @@ - > + >     - > + > @@ -17,13 +17,11 @@ - > - + >     - > - + > @@ -171,18 +169,16 @@ > - - -  ,   + +     >

- + - @@ -195,16 +191,16 @@ - > + >     - > + > - @@ -214,7 +210,7 @@ - @@ -235,7 +231,7 @@ - > + > >
@@ -243,6 +239,16 @@ + + + + + > +     + > + + + @@ -258,3 +264,5 @@ ">  "> + + diff --git a/webcit/static/t/view_blog/comment_box.html b/webcit/static/t/view_blog/comment_box.html index 1d60f4029..d8fedefbb 100644 --- a/webcit/static/t/view_blog/comment_box.html +++ b/webcit/static/t/view_blog/comment_box.html @@ -11,6 +11,7 @@ function submit_comment() { "> +