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 d3fab4f154c78d6340142fa63de02b5026b8711b Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Thu May 28 15:44:41 2015 +0200 Fix a bug with the repository browsing when multiple directories had names which begin with the same characters --- .../org/nuiton/scmwebeditor/git/GitConnection.java | 5 ++- .../webapp/WEB-INF/content/modificationViewer.jsp | 46 +++++++++++----------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java index 6d28959..57d0cce 100644 --- a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java +++ b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java @@ -260,7 +260,10 @@ public class GitConnection implements ScmConnection { String fileName = address + File.separator + treeWalk.getPathString(); - if (fileName.startsWith(url) || url.startsWith(fileName)) { + String fileNameComplete = fileName + File.separator; + String urlComplete = url + File.separator; + + if (fileNameComplete.startsWith(urlComplete) || urlComplete.startsWith(fileNameComplete)) { // subtree = directory if (treeWalk.isSubtree()) { diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp index 68fffd1..33ec043 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp @@ -73,9 +73,9 @@ function confirmExit() { var text = '<s:text name="scm.exitJavascript"/>'; - if (document.getElementById('newTextId').value != editor.getValue()) { + if (document.getElementById('newTextId').value != editor.getValue()) { text = '<s:text name="scm.exitJavascriptChanges"/>'; - } + } return cancelRedirect(text, document.getElementById('projectUrl')); } @@ -129,37 +129,37 @@ Functions related to the browsing tree */ $.subscribe('treeClicked', function(event, data) { - var item = event.originalEvent.data.rslt.obj; + var item = event.originalEvent.data.rslt.obj; - if (item.length == 1) { - var classAttr = item[0].getAttribute("class"); + if (item.length == 1) { + var classAttr = item[0].getAttribute("class"); - if (classAttr.contains("jstree-leaf")) { - var scmType = $("#scmType").val(); - var selectedBranch = $("#selectedBranchDisplay").text().trim(); + if (classAttr.contains("jstree-leaf")) { + var scmType = $("#scmType").val(); + var selectedBranch = $("#selectedBranchDisplay").text().trim(); - document.location.href = ("edit.action?address=" + item.attr("id") + "&scmType=" + scmType - + '&selectedBranch=<s:property value="selectedBranch"/>'); - } + document.location.href = ("edit.action?address=" + item.attr("id") + "&scmType=" + scmType + + '&selectedBranch=<s:property value="selectedBranch"/>'); } + } - }); + }); - // automatically expand the directory when there is no other file - $.subscribe('treeChanged', function(event, data) { + // automatically expand the directory when there is no other file + $.subscribe('treeChanged', function(event, data) { - var json = event.originalEvent.data.responseJSON; + var json = event.originalEvent.data.responseJSON; - if (json.length == 1) { - var object = json[0]; + if (json.length == 1) { + var object = json[0]; - if (object.state == "closed") { - var htmlObject = document.getElementById(object.id); - var children = htmlObject.children; - children.item('ins').click(); - } + if (object.state == "closed") { + var htmlObject = document.getElementById(object.id); + var children = htmlObject.children; + children.item('ins').click(); } - }); + } + }); window.onbeforeunload = confirmExitOnUnload; -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.