| | |
| | |
|
| | | import org.apache.wicket.Component;
|
| | | import org.apache.wicket.PageParameters;
|
| | | import org.apache.wicket.RedirectException;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.image.Image;
|
| | | import org.apache.wicket.markup.html.link.BookmarkablePageLink;
|
| | |
| | | final String blobPath = WicketUtils.getPath(params);
|
| | | String [] encodings = getEncodings();
|
| | |
|
| | | if (StringUtils.isEmpty(objectId) && StringUtils.isEmpty(blobPath)) {
|
| | | throw new RedirectException(TreePage.class, WicketUtils.newRepositoryParameter(repositoryName));
|
| | | }
|
| | |
|
| | | if (StringUtils.isEmpty(blobPath)) {
|
| | | // blob by objectid
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // see if we should redirect to the doc page
|
| | | MarkupProcessor processor = new MarkupProcessor(app().settings());
|
| | | MarkupProcessor processor = new MarkupProcessor(app().settings(), app().xssFilter());
|
| | | for (String ext : processor.getMarkupExtensions()) {
|
| | | if (ext.equals(extension)) {
|
| | | setResponsePage(DocPage.class, params);
|
| | |
| | | table = missingBlob(blobPath, commit);
|
| | | } else {
|
| | | table = generateSourceView(source, extension, type == 1);
|
| | | addBottomScriptInline("jQuery(prettyPrint);");
|
| | | }
|
| | | add(new Label("blobText", table).setEscapeModelStrings(false));
|
| | | add(new Image("blobImage").setVisible(false));
|
| | |
| | | table = missingBlob(blobPath, commit);
|
| | | } else {
|
| | | table = generateSourceView(source, null, false);
|
| | | addBottomScriptInline("jQuery(prettyPrint);");
|
| | | }
|
| | | add(new Label("blobText", table).setEscapeModelStrings(false));
|
| | | add(new Image("blobImage").setVisible(false));
|
| | |
| | | } else {
|
| | | sb.append("<pre class=\"plainprint\">");
|
| | | }
|
| | | lines = StringUtils.escapeForHtml(source, true).split("\n");
|
| | | final int tabLength = app().settings().getInteger(Keys.web.tabLength, 4);
|
| | | lines = StringUtils.escapeForHtml(source, true, tabLength).split("\n");
|
| | |
|
| | | sb.append("<table width=\"100%\"><tbody>");
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | protected boolean isCommitPage() {
|
| | | return true;
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected Class<? extends BasePage> getRepoNavPageClass() {
|
| | | return TreePage.class;
|
| | | }
|