Add preview feature on description textarea.

This commit is contained in:
OHTAKE Tomohiro committed 2011-11-07 15:54:49 +09:00
1 parent a9b55e9d54
commit cfbb2d6e2a
8 files changed
+65 -6

No files matched your search

@@ -90,6 +90,16 @@ public class AllView extends View {
rsp.sendRedirect(".");
}
/**
* Generate HTML for preview, using markup formatter.
* Can be called from other views.
*/
public void doPreviewDescription( StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
String desc = req.getParameter("description");
rsp.setContentType("text/html; charset=UTF-8"); // UTF-8 required by XHR
Jenkins.getInstance().getMarkupFormatter().translate(desc, rsp.getWriter());
}
@Override
public String getPostConstructLandingPage() {
return ""; // there's no configuration page