This is an automated email from the git hooks/post-receive script. New commit to branch feature/GIT in repository scmwebeditor. See http://git.nuiton.org/scmwebeditor.git commit 7c1c5ead5e796d79bfc03cde73c5a009b834356c Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Tue Apr 28 10:03:09 2015 +0200 In the search tree, when there is only one folder, it is automatically expanded --- src/main/webapp/WEB-INF/content/outConnection.jsp | 16 ++++++++++------ src/main/webapp/WEB-INF/content/search.jsp | 19 ++++++++++++++++++- src/main/webapp/WEB-INF/content/uploadForm.jsp | 18 ++++++++++++++++++ 3 files changed, 46 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/WEB-INF/content/outConnection.jsp b/src/main/webapp/WEB-INF/content/outConnection.jsp index 96642f2..edb5ee3 100644 --- a/src/main/webapp/WEB-INF/content/outConnection.jsp +++ b/src/main/webapp/WEB-INF/content/outConnection.jsp @@ -123,14 +123,18 @@ </center> - <s:text name="scm.outConnection.scmType"/> - <s:select id="scmType" name="scmType" list="supportedScms"/> + <label> + <s:text name="scm.outConnection.scmType"/> + <s:select id="scmType" name="scmType" list="supportedScms"/> + </label> <div id="branches"> - <s:text name="scm.outConnection.selectBranch"/> - <select id="branchesList"> - <option value=""><s:text name="scm.outConnection.branches"/> - </select> + <label> + <s:text name="scm.outConnection.selectBranch"/> + <select id="branchesList"> + <option value=""><s:text name="scm.outConnection.branches"/> + </select> + </label> </div> <div id="htmlcontentSearch"></div> diff --git a/src/main/webapp/WEB-INF/content/search.jsp b/src/main/webapp/WEB-INF/content/search.jsp index 1621721..89c7bca 100644 --- a/src/main/webapp/WEB-INF/content/search.jsp +++ b/src/main/webapp/WEB-INF/content/search.jsp @@ -39,12 +39,28 @@ }); + // automatically expand the directory when there is no other file + $.subscribe('treeChanged', function(event, data) { + + var json = event.originalEvent.data.responseJSON; + + if (json.length == 1) { + var object = json[0]; + + if (object.title.startsWith('/')) { + var htmlObject = document.getElementById(object.id); + var children = htmlObject.children; + children.item('ins').click(); + } + } + }); + </script> <s:if test="scmType.equals('Git') && !error"> <s:text name="scm.outConnection.headBranch"/> <s:if test="selectedBranch != null"> - <s:if test="selectedBranch != ''"> + <s:if test="!selectedBranch.equals('')"> <s:label name="selectedBranch"></s:label> </s:if> <s:else> @@ -75,6 +91,7 @@ jstreetheme="classic" href="%{searchTreeUrl}" onClickTopics="treeClicked" + onSuccessTopics="treeChanged" /> </div> diff --git a/src/main/webapp/WEB-INF/content/uploadForm.jsp b/src/main/webapp/WEB-INF/content/uploadForm.jsp index 645e3ed..d6048db 100644 --- a/src/main/webapp/WEB-INF/content/uploadForm.jsp +++ b/src/main/webapp/WEB-INF/content/uploadForm.jsp @@ -33,6 +33,7 @@ <title>UploadFile</title> <link rel="stylesheet" type="text/css" href="css/main.css"> <link rel="stylesheet" type="text/css" href="css/uploadForm.css"> + <script type="text/javascript" src="js/branches.js"></script> </head> @@ -50,6 +51,22 @@ }); + // automatically expand the directory when there is no other file + $.subscribe('treeChanged', function(event, data) { + + var json = event.originalEvent.data.responseJSON; + + if (json.length == 1) { + var object = json[0]; + + if (object.title.startsWith('/')) { + var htmlObject = document.getElementById(object.id); + var children = htmlObject.children; + children.item('ins').click(); + } + } + }); + </script> @@ -77,6 +94,7 @@ jstreetheme="classic" href="%{searchTreeUrl}" onClickTopics="treeClicked" + onSuccessTopics="treeChanged" /> </div> -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.