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 afa3c217d3462cb1f9882bd2b299cb0ad1409425 Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Wed May 27 10:22:37 2015 +0200 Remove the commit message and connection forms from the edit page, they are in a popin instead. Make the header of the edit page fixed to the top of the screen. --- .../scmwebeditor/uiweb/actions/SaveAction.java | 10 +- .../i18n/scmwebeditor-ui-web_en_GB.properties | 5 +- .../i18n/scmwebeditor-ui-web_fr_FR.properties | 5 +- swe-ui-web/src/main/resources/struts.xml | 6 +- .../webapp/WEB-INF/content/modificationViewer.jsp | 361 ++++++++++----------- swe-ui-web/src/main/webapp/css/main.css | 78 +++-- .../webapp/img/editor/machine-a-ecrire-head.png | Bin 0 -> 20024 bytes 7 files changed, 236 insertions(+), 229 deletions(-) diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java index 3564341..3271ae5 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java @@ -5,16 +5,16 @@ * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public + * + * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% diff --git a/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_en_GB.properties b/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_en_GB.properties index 9b54b17..9720a75 100644 --- a/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_en_GB.properties +++ b/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_en_GB.properties @@ -8,8 +8,8 @@ scm.cannotSave=Can't save modification. scm.cantFindRepo=Can't find the repository. scm.clickHere=click here scm.close=Close -scm.commitMessage=Commit message -scm.commitMessageTitle=let a message for commit +scm.commitMessage=Message describing the changes\: +scm.commitMessageTitle=Let a message to describe the changes scm.connection=Connection scm.createBranch=Create a new branch scm.createBranch.branchName=Name of the new branch\: @@ -74,6 +74,7 @@ scm.titles.badRstFile=RST not valid scm.titles.error=Error... scm.titles.logout=Logout... scm.titles.privateScm=Private repository +scm.titles.saveChanges=Save the changes scm.titles.success=Success scm.titles.swe=SCMWebEditor scm.titles.upload=Upload a file diff --git a/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_fr_FR.properties b/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_fr_FR.properties index 65878bb..b81b4a8 100644 --- a/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_fr_FR.properties +++ b/swe-ui-web/src/main/resources/i18n/scmwebeditor-ui-web_fr_FR.properties @@ -8,8 +8,8 @@ scm.cannotSave=Modification impossible scm.cantFindRepo=Impossible de trouver le dépôt. scm.clickHere=cliquez ici scm.close=Fermer -scm.commitMessage=Message associé au commit -scm.commitMessageTitle=laisser un message pour le commit +scm.commitMessage=Message associé aux modifications \: +scm.commitMessageTitle=Laisser un message pour décrire les modifications scm.connection=Connexion scm.createBranch=Créer une nouvelle branche scm.createBranch.branchName=Nom de la nouvelle branche \: @@ -74,6 +74,7 @@ scm.titles.badRstFile=RST non valide scm.titles.error=Erreur... scm.titles.logout=Déconnexion... scm.titles.privateScm=Dépôt privé +scm.titles.saveChanges=Enregistrer les modifications scm.titles.success=Réussi scm.titles.swe=SCMWebEditor scm.titles.upload=Ajouter un fichier diff --git a/swe-ui-web/src/main/resources/struts.xml b/swe-ui-web/src/main/resources/struts.xml index 6f6d65f..3e2e6b5 100644 --- a/swe-ui-web/src/main/resources/struts.xml +++ b/swe-ui-web/src/main/resources/struts.xml @@ -86,7 +86,8 @@ </action> <action name="save" class="org.nuiton.scmwebeditor.uiweb.actions.SaveAction"> - <result>/WEB-INF/content/save.jsp</result> + <result name="success">/WEB-INF/content/save.jsp</result> + <result name="prepareCommit">/WEB-INF/content/commitForm.jsp</result> </action> <action name="reset" class="org.nuiton.scmwebeditor.uiweb.actions.ResetAction"> @@ -123,8 +124,7 @@ <action name="preview" class="org.nuiton.scmwebeditor.uiweb.actions.PreviewAction"> <result>/WEB-INF/content/preview.jsp</result> </action> - - + <action name="browse" class="org.nuiton.scmwebeditor.uiweb.actions.BrowseAction"> <param name="address"/> <result name="root">/WEB-INF/content/browse.jsp</result> 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 2ce2a99..d881764 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 @@ -74,13 +74,23 @@ return cancelRedirect(text, document.getElementById('projectUrl')); } - function confirmExitUnload() { + function confirmExitOnUnload() { if (document.getElementById('newTextId').value != editor.getValue()) { return '<s:text name="scm.exitJavascript"/>'; } } - window.onbeforeunload = confirmExitUnload; + function openCommitPopin() { + document.getElementById("commitPopin").style.display = "block"; + document.getElementById("popinBackground").style.display = "block"; + } + + function closeCommitPopin() { + document.getElementById("commitPopin").style.display = "none"; + document.getElementById("popinBackground").style.display = "none"; + } + + window.onbeforeunload = confirmExitOnUnload; </script> <s:if test="format == 'rst'"> @@ -144,78 +154,6 @@ <!-- authentication --> -<div id="headLogin"> - - <div id="authDiv"> - <h3><s:text name="scm.connection"/></h3> - - <s:if test="username==null || pw==null"> - <s:set id="scm.username"> - <s:text name="scm.username"/> - </s:set> - <s:set id="scm.usernameTitle"> - <s:text name="scm.usernameTitle"/> - </s:set> - <s:set id="scm.password"> - <s:text name="scm.password"/> - </s:set> - <s:set id="scm.passwordTitle"> - <s:text name="scm.passwordTitle"/> - </s:set> - - <s:textfield accesskey="U" size="12" label="%{scm.username}" - name="username" title="%{scm.usernameTitle}"/> - <s:password accesskey="P" size="12" label="%{scm.password}" name="pw" - title="%{scm.passwordTitle}"/> - <input type="checkbox" name="saveCookie" value="true"><s:text - name="scm.stayLogin"/> - </s:if> - <s:else> - - <s:set id="addressDeco"> - <s:property value="address"/> - </s:set> - <s:set id="projectUrlDeco"> - <s:property value="address"/> - </s:set> - <s:a - id="logout" - href="logout.action?address=%{addressDeco}&projectUrl=%{projectUrlDeco}&scmType=%{scmType}&selectedBranch=%{selectedBranch}" - title="Logout" - > - <div id="logoutButton"></div> - </s:a> - - <s:text name="scm.logAs"/> <s:property value="username"/> - - - <br/> - </s:else> - - <div id="htmlcontentCommit"> - <s:if test="badLogin"> - <p> - <font color="red"> - <s:text name="scm.badUsernameOrPassword"/> - </font> - </p> - </s:if> - </div> - - - </div> - - - <noscript> - <s:set id="scm.saveAndQuitTitle"> - <s:text name="scm.saveAndQuitTitle"/> - </s:set> - <s:submit - value="commit" - title="Deconnexion" - name="Save" - /> - </noscript> <div id="buttonList"> @@ -225,16 +163,8 @@ <s:set id="scm.saveAndContinueTitle"> <s:text name="scm.saveAndContinueTitle"/> </s:set> - <sj:a - onclick="loadChange()" - id="ajaxSaveButton" - formIds="editForm" - targets="htmlcontentCommit" - href="%{ajaxCommit}" - title="%{scm.saveAndContinueTitle}" - > - <div id="saveButton"></div> - </sj:a> + + <s:div id="saveButton" onclick="loadChange(); openCommitPopin();" title="%{scm.saveAndContinueTitle}"></s:div> <!--END Save and continue --> <!--BEGIN preview --> @@ -320,169 +250,204 @@ <!-- END exit --> </div> + </div> +<div id="editBody"> -<s:set id="scm.commitMessage"> - <s:text name="scm.commitMessage"/> -</s:set> -<s:set id="scm.commitMessageTitle"> - <s:text name="scm.commitMessageTitle"/> -</s:set> + <s:hidden key="format" label=''/> + <s:hidden key="mimeType" label=''/> -<div id="commitArea"> - <s:textarea cols="60" label="%{scm.commitMessage} " name="commitMessage" - title="%{scm.commitMessageTitle}"></s:textarea> + <s:if test="format=='rst'"> + <h4><s:text name="scm.info.ProblemWithRst"/> <a + href="http://docutils.sourceforge.net/docs/user/rst/quickref.html"><s:text + name="scm.info.rstWebsite"/></a>.</h4> + </s:if> - <s:if test="scmSupportsPush"> - <input type="checkbox" name="commitOnly" id="commitOnly" value="true"/> - <label for="commitOnly"><s:text name="scm.modificationViewer.commitOnly"/></label> - <script type="text/javascript"> - document.getElementById("commitMessage").style.height = "35px"; - </script> + <p> + <s:text name="scm.FileInEditor"/> <s:a href="%{address}"><s:property + value="address"/></s:a> + <s:text name="scm.atRevision"/> <span id="numrevisionDiv"><s:property + value="numRevision"/></span> - </s:if> -</div> -</div> + <s:if test="scmSupportsBranches"> + <br/> + <s:text name="scm.modificationViewer.branch"/> <s:property value="selectedBranch"></s:property> + </s:if> + </p> + <s:if test="format == 'rst'"> -<s:hidden key="format" label=''/> -<s:hidden key="mimeType" label=''/> + <label> + <s:text name="scm.modificationViewer.previewPosition"/> + <select id="previewPosition"> + <option value="side"><s:text name="scm.modificationViewer.previewPosition.side"/></option> + <option value="below"><s:text name="scm.modificationViewer.previewPosition.below"/></option> + <option value="none"><s:text name="scm.modificationViewer.previewPosition.none"/></option> + </select> + </label> -<s:if test="format=='rst'"> - <h4><s:text name="scm.info.ProblemWithRst"/> <a - href="http://docutils.sourceforge.net/docs/user/rst/quickref.html"><s:text - name="scm.info.rstWebsite"/></a>.</h4> -</s:if> + <div id="largeEditor"> + <div id="largeEditorCode"> + </s:if> -<p> - <s:text name="scm.FileInEditor"/> <s:a href="%{address}"><s:property - value="address"/></s:a> - <s:text name="scm.atRevision"/> <span id="numrevisionDiv"><s:property - value="numRevision"/></span> + <textarea id="newTextId" name="newText"><s:property + escapeHtml="false" value="OrigText"/></textarea> - <s:if test="scmSupportsBranches"> - <br/> - <s:text name="scm.modificationViewer.branch"/> <s:property value="selectedBranch"></s:property> + + <script type="text/javascript"> + var textarea = document.getElementById('newTextId'); + var uiOptions = { path : 'codemirror-ui/js/', searchMode : 'inline', imagePath: 'codemirror-ui/images/silk', + buttons: ['undo', 'redo', 'jump', 'reindentSelection', 'reindent'] } + var codeMirrorOptions = { mode: "null", lineNumbers: true, lineWrapping: true } + var editor = new CodeMirrorUI(textarea, uiOptions, codeMirrorOptions); + </script> + + + <s:if test="format == 'rst'"> + </div> + <div id="largeEditorPreview"> + <div id="htmlcontentPreview"></div> + </div> + </div> </s:if> -</p> -<s:if test="format == 'rst'"> - <label> - <s:text name="scm.modificationViewer.previewPosition"/> - <select id="previewPosition"> - <option value="side"><s:text name="scm.modificationViewer.previewPosition.side"/></option> - <option value="below"><s:text name="scm.modificationViewer.previewPosition.below"/></option> - <option value="none"><s:text name="scm.modificationViewer.previewPosition.none"/></option> + <label><s:text name="scm.language"/> + <select id="language" name="langageSelection" + onchange="changeModeBy(editor,this)"> + <option value="null"><s:text name="scm.text"/></option> + <option value="rst">ReStructuredText</option> + <option value="javascript">Javascript</option> + <option value="text/html">HTML</option> + <option value="xml">XML</option> + <option value="text/x-java">JAVA</option> + <option value="css">CSS</option> + <option value="stex">LaTeX</option> </select> </label> - <div id="largeEditor"> - <div id="largeEditorCode"> -</s:if> + <script type='text/javascript'> + selectLanguage('<s:property value="mimeType"/>', '<s:property value="format"/>'); + changeModeBy(editor, document.getElementById('language')); + </script> -<textarea id="newTextId" name="newText"><s:property - escapeHtml="false" value="OrigText"/></textarea> + <noscript><h4><s:text name="scm.modificationViewer.noJavascript"/></h4> + </noscript> + <noscript><h4><s:text name="scm.modificationViewer.betterUseJavascript"/></h4> + </noscript> -<script type="text/javascript"> - var textarea = document.getElementById('newTextId'); - var uiOptions = { path : 'codemirror-ui/js/', searchMode : 'inline', imagePath: 'codemirror-ui/images/silk', - buttons: ['undo', 'redo', 'jump', 'reindentSelection', 'reindent'] } - var codeMirrorOptions = { mode: "null", lineNumbers: true, lineWrapping: true } - var editor = new CodeMirrorUI(textarea, uiOptions, codeMirrorOptions); -</script> + <div id="form"> -<s:if test="format == 'rst'"> - </div> - <div id="largeEditorPreview"> - <div id="htmlcontentPreview"></div> - </div> - </div> -</s:if> + <p> -<label><s:text name="scm.language"/> - <select id="language" name="langageSelection" - onchange="changeModeBy(editor,this)"> - <option value="null"><s:text name="scm.text"/></option> - <option value="rst">ReStructuredText</option> - <option value="javascript">Javascript</option> - <option value="text/html">HTML</option> - <option value="xml">XML</option> - <option value="text/x-java">JAVA</option> - <option value="css">CSS</option> - <option value="stex">LaTeX</option> - </select> -</label> + <s:hidden key="address" label=''/> + <s:hidden key="origText" label=''/> + <s:hidden key="scmEditorUrl" label=''/> -<script type='text/javascript'> - selectLanguage('<s:property value="mimeType"/>', '<s:property value="format"/>'); - changeModeBy(editor, document.getElementById('language')); -</script> + <div id="scmButton"></div> + </div> +</div> +</form> -<noscript><h4><s:text name="scm.modificationViewer.noJavascript"/></h4> -</noscript> -<noscript><h4><s:text name="scm.modificationViewer.betterUseJavascript"/></h4> -</noscript> + <s:set id="scm.upload"> + <s:text name="scm.upload"/> + </s:set> + <s:set id="scm.uploadTitle"> + <s:text name="scm.uploadTitle"/> + </s:set> -<div id="form"> + <s:set id="scm.removeFile"> + <s:text name="scm.removeFile"/> + </s:set> + <s:set id="scm.removeFileTitle"> + <s:text name="scm.removeFileTitle"/> + </s:set> + <s:set name="address"> + <s:property value="address"/> + </s:set> - <p> + <center> + <s:submit name="uploadButton" value="%{scm.upload}" title="%{scm.uploadTitle}" + onClick="javascript:open_popup('doUpload.action', 'upload' , getElementById('address').value, '%{scmType}' );"/> + <s:submit name="removeButton" value="%{scm.removeFile}" title="%{scm.removeFileTitle}" + onClick="javascript:open_popup('doRemove.action', 'remove' , getElementById('address').value, '%{scmType}' );"/> + </center> - <s:hidden key="address" label=''/> - <s:hidden key="origText" label=''/> - <s:hidden key="scmEditorUrl" label=''/> + <div id="targetContentUpload"></div> - <div id="scmButton"></div> + </div> + <p align="right">©2004-2015 CodeLutin</p> </div> -</form> - -<s:set id="scm.upload"> - <s:text name="scm.upload"/> -</s:set> -<s:set id="scm.uploadTitle"> - <s:text name="scm.uploadTitle"/> -</s:set> -<s:set id="scm.removeFile"> - <s:text name="scm.removeFile"/> -</s:set> -<s:set id="scm.removeFileTitle"> - <s:text name="scm.removeFileTitle"/> -</s:set> +<!-- popin for commit message and authentication information --> +<div id="commitPopin"> + <span id="closeCommitPopin" onclick="closeCommitPopin()"> + X + </span> -<s:set name="address"> - <s:property value="address"/> -</s:set> -<center> - <s:submit name="uploadButton" value="%{scm.upload}" title="%{scm.uploadTitle}" - onClick="javascript:open_popup('doUpload.action', 'upload' , getElementById('address').value, '%{scmType}' );"/> + <h1><s:text name="scm.titles.saveChanges"/></h1> - <s:submit name="removeButton" value="%{scm.removeFile}" title="%{scm.removeFileTitle}" - onClick="javascript:open_popup('doRemove.action', 'remove' , getElementById('address').value, '%{scmType}' );"/> -</center> + <form id="commitForm"> + <label for="commitMessage"><s:text name="scm.commitMessage"/></label> + <textarea id="commitMessage" name="commitMessage"></textarea><br/> -<div> + <s:if test="username==null || pw==null"> + <label for="username"><s:text name="scm.username"/> :</label> <input type="text" name="username" id="username"/><br/> + <label for="pw"><s:text name="scm.password"/> :</label> <input type="password" id="pw" name="pw"/><br/> + </s:if> + <s:else> + <s:text name="scm.logAs"/> <s:property value="username"/> <br/> + </s:else> + </form> + + <s:set id="scm.submit"> + <s:text name="scm.submit"/> + </s:set> + + <sj:a + onclick="loadChange()" + id="ajaxSaveButton" + formIds="editForm,commitForm" + targets="htmlcontentCommit" + href="%{ajaxCommit}" + title="%{scm.saveAndContinueTitle}" + > + <s:submit id="Save" value="%{scm.submit}"/> + </sj:a> + + <div id="htmlcontentCommit"> + <s:if test="badLogin"> + <p> + <font color="red"> + <s:text name="scm.badUsernameOrPassword"/> + </font> + </p> + </s:if> + </div> </div> -<div id="targetContentUpload"></div> +<div id="popinBackground"></div> + + <script type="text/javascript"> + document.getElementById("commitPopin").style.display = "none"; + document.getElementById("popinBackground").style.display = "none"; + </script> -</div> -<p align="right">©2004-2015 CodeLutin</p> </body> </html> diff --git a/swe-ui-web/src/main/webapp/css/main.css b/swe-ui-web/src/main/webapp/css/main.css index b726a7f..f370bb0 100644 --- a/swe-ui-web/src/main/webapp/css/main.css +++ b/swe-ui-web/src/main/webapp/css/main.css @@ -115,6 +115,10 @@ ul.flags li { text-align:center; } +#wwctrl_Save { + margin-top: 15px; +} + #wwctrl_exitLogin { text-align:left; display:inline; @@ -174,17 +178,19 @@ ul.flags li { #wrapper { - background-image:url("../img/editor/head.png"); - background-repeat:repeat-x; + margin-top: 150px; } #head { margin:auto; - height:190px; - background-image:url("../img/editor/machine-a-ecrire.png"); - background-repeat:no-repeat; - background-position:20px top; + height:125px; + background: url("../img/editor/machine-a-ecrire-head.png") no-repeat 8% top, + url("../img/editor/head.png") repeat-x; + position: fixed; + width: 90%; + top: 0; + z-index: 5; } #headLogin { @@ -206,7 +212,11 @@ ul.flags li { } #htmlcontentCommit { - height:77px + width: 80%; + position: relative; + margin: auto; + text-align: center; + margin-top: 10px; } @@ -214,8 +224,8 @@ ul.flags li { width:170px; height:32px; position:relative; - left:169px; - top:147px; + top:20px; + left: 75%; } @@ -229,15 +239,9 @@ ul.flags li { margin-left : 10px; } - -#commitArea { - margin-left: 26%; - margin-top: 68px; - width: 40%; -} - #commitMessage { - width: 100%; + width: 30em; + height: 5em; display: block; } @@ -252,6 +256,7 @@ ul.flags li { #saveButton:hover { background-image:url("../img/editor/save-hover.png"); + cursor: pointer; } #previewButton { @@ -314,8 +319,8 @@ ul.flags li { margin:auto; width:198px; position:relative; - top:53px; - right:49px; + top:40px; + right:10px; } #uploadFormId { @@ -393,4 +398,39 @@ ul.flags li { #wwctrl_submitPrivateScm { display: inline; +} + +#commitPopin { + position: fixed; + width: 50%; + height: 350px; + background-color: white; + border: 1px solid black; + z-index: 11; + top: 20%; + left: 25%; + padding: 10px; +} + +#popinBackground { + position: fixed; + width: 100%; + height: 100%; + z-index: 10; + background-color: rgba(100, 100, 100, 0.5); + top: 0; + left: 0; +} + +#closeCommitPopin { + float: right; +} + +#closeCommitPopin:hover { + cursor: pointer; + color: red; +} + +#ajaxSaveButton { + text-decoration: none; } \ No newline at end of file diff --git a/swe-ui-web/src/main/webapp/img/editor/machine-a-ecrire-head.png b/swe-ui-web/src/main/webapp/img/editor/machine-a-ecrire-head.png new file mode 100644 index 0000000..782f785 Binary files /dev/null and b/swe-ui-web/src/main/webapp/img/editor/machine-a-ecrire-head.png differ -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.