From d242cf7a6d37261e74a8ca70803a5eea65659428 Mon Sep 17 00:00:00 2001 From: low012 Date: Tue, 16 Aug 2005 01:19:29 +0000 Subject: [PATCH] added a Preview button to yacyWiki git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@543 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Wiki.java | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/htroot/Wiki.java b/htroot/Wiki.java index 9247ebb56..7675fda2c 100644 --- a/htroot/Wiki.java +++ b/htroot/Wiki.java @@ -128,10 +128,48 @@ public class Wiki { "" + "" + "" + + "" + "" + ""); } catch (UnsupportedEncodingException e) {} - } else if (post.containsKey("index")) { + } + + //contributed by [MN] + else if (post.containsKey("preview")) { + // preview the page + wikiCode wikiTransformer=new wikiCode(switchboard); + + prop.put("pagecontent", + "

Preview

No changes have been submitted so far!

" + + "" + + "" + + "
 " + + "yacyWiki page: " + pagename + ",   last edited by " + author + + ",   change date " + dateString(new Date()) + + "
" + + "
" + + wikiTransformer.transform(((String) post.get("content", ""))) + + "
" + + "
"); + + prop.put("pageedit", + "
" + + //"" + + "" + + "


" + + "

Edit

"+ + "

Author:

" + + "

Text:

" + + "" + + "" + + "" + + "" + + "" + + "
"); + } + //end contrib of [MN] + + else if (post.containsKey("index")) { // view an index String index = "" + ""; @@ -159,7 +197,9 @@ public class Wiki { "" + "" + ""); - } else { + } + + else { wikiCode wikiTransformer=new wikiCode(switchboard); // show page prop.put("pagecontent",
SubjectChange DateAuthor