branch develop updated (30ebbd8 -> 4eb5b0b)
This is an automated email from the git hooks/post-receive script. New change to branch develop in repository scmwebeditor. See http://git.nuiton.org/scmwebeditor.git from 30ebbd8 Add an icon to the image files in the browsing trees new 4eb5b0b Make the page reload from the popups keep given information instead of completely reload everything The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit 4eb5b0b68ab3e1c1ae63e39549d0c40db6b7aa2c Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Mon Jun 1 17:35:14 2015 +0200 Make the page reload from the popups keep given information instead of completely reload everything Summary of changes: .../org/nuiton/scmwebeditor/uiweb/actions/ViewImageAction.java | 10 ++++++++++ .../main/webapp/WEB-INF/content/popups/createBranchSuccess.jsp | 2 +- .../webapp/WEB-INF/content/popups/createDirectorySuccess.jsp | 2 +- .../src/main/webapp/WEB-INF/content/popups/moveFileSuccess.jsp | 2 +- .../webapp/WEB-INF/content/popups/removeDirectorySuccess.jsp | 2 +- .../main/webapp/WEB-INF/content/popups/removeFileSuccess.jsp | 2 +- .../main/webapp/WEB-INF/content/popups/uploadFileSuccess.jsp | 2 +- 7 files changed, 16 insertions(+), 6 deletions(-) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository scmwebeditor. See http://git.nuiton.org/scmwebeditor.git commit 4eb5b0b68ab3e1c1ae63e39549d0c40db6b7aa2c Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Mon Jun 1 17:35:14 2015 +0200 Make the page reload from the popups keep given information instead of completely reload everything --- .../org/nuiton/scmwebeditor/uiweb/actions/ViewImageAction.java | 10 ++++++++++ .../main/webapp/WEB-INF/content/popups/createBranchSuccess.jsp | 2 +- .../webapp/WEB-INF/content/popups/createDirectorySuccess.jsp | 2 +- .../src/main/webapp/WEB-INF/content/popups/moveFileSuccess.jsp | 2 +- .../webapp/WEB-INF/content/popups/removeDirectorySuccess.jsp | 2 +- .../main/webapp/WEB-INF/content/popups/removeFileSuccess.jsp | 2 +- .../main/webapp/WEB-INF/content/popups/uploadFileSuccess.jsp | 2 +- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ViewImageAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ViewImageAction.java index a6ea51f..0249d48 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ViewImageAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ViewImageAction.java @@ -36,6 +36,8 @@ import javax.servlet.http.Cookie; import javax.servlet.http.HttpSession; import java.io.File; import java.text.Normalizer; +import java.util.Arrays; +import java.util.List; /** * Allows to view an image @@ -46,6 +48,8 @@ public class ViewImageAction extends ScmWebEditorMainAction { protected final String VIEW_IMAGE = "viewImage"; + protected final List<String> SUPPORTED_IMAGE_FORMATS = Arrays.asList("jpg", "jpeg", "png", "gif"); + /** the name of the selected branch */ protected String selectedBranch; @@ -89,6 +93,12 @@ public class ViewImageAction extends ScmWebEditorMainAction { */ public String execute() { + String imageFormat = address.substring(address.lastIndexOf('.') + 1).toLowerCase(); + + if (!SUPPORTED_IMAGE_FORMATS.contains(imageFormat)) { + return ERROR_PATH; + } + HttpSession session = request.getSession(); String sessionId = session.getId(); diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createBranchSuccess.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createBranchSuccess.jsp index 4b36521..f973b0d 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createBranchSuccess.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createBranchSuccess.jsp @@ -33,7 +33,7 @@ <title><s:text name="scm.titles.success"/></title> <script type="text/javascript"> - window.opener.document.location.reload(true); + window.opener.document.location.reload(false); </script> </head> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createDirectorySuccess.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createDirectorySuccess.jsp index 0f1a5ef..9c8bef8 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createDirectorySuccess.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/createDirectorySuccess.jsp @@ -43,7 +43,7 @@ + "&selectedBranch=" + selectedBranch + "&repositoryRoot=" + repositoryRoot; } else { - window.opener.document.location.reload(true); + window.opener.document.location.reload(false); } </script> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/moveFileSuccess.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/moveFileSuccess.jsp index 47adc8f..627c8c4 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/moveFileSuccess.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/moveFileSuccess.jsp @@ -43,7 +43,7 @@ + "&selectedBranch=" + selectedBranch + "&repositoryRoot=" + repositoryRoot; } else { - window.opener.document.location.reload(true); + window.opener.document.location.reload(false); } </script> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeDirectorySuccess.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeDirectorySuccess.jsp index 08307b3..41e557b 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeDirectorySuccess.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeDirectorySuccess.jsp @@ -43,7 +43,7 @@ + "&selectedBranch=" + selectedBranch + "&repositoryRoot=" + repositoryRoot; } else { - window.opener.document.location.reload(true); + window.opener.document.location.reload(false); } </script> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeFileSuccess.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeFileSuccess.jsp index 41f741b..fb2b6ce 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeFileSuccess.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/removeFileSuccess.jsp @@ -43,7 +43,7 @@ + "&selectedBranch=" + selectedBranch + "&repositoryRoot=" + repositoryRoot; } else { - window.opener.document.location.reload(true); + window.opener.document.location.reload(false); } </script> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/uploadFileSuccess.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/uploadFileSuccess.jsp index d7f19b4..d4771e3 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/popups/uploadFileSuccess.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/popups/uploadFileSuccess.jsp @@ -43,7 +43,7 @@ + "&selectedBranch=" + selectedBranch + "&repositoryRoot=" + repositoryRoot; } else { - window.opener.document.location.reload(true); + window.opener.document.location.reload(false); } </script> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm