mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 13:32:24 +00:00
Add preview feature on description textarea.
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user