Salome HOME
Show and Edit comments functionalities are implemented
[tools/siman.git] / Workspace / Siman / WebContent / jsp / commentPane.jsp
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2     pageEncoding="ISO-8859-1"%>
3 <%@ taglib prefix="s" uri="/struts-tags"%>
4 <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
5
6 <div id="display_comments_div">
7   <tiles:insertAttribute name="display_comments_pane" ignore="true" />
8 </div>
9
10 <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
11         <script type="text/javascript">
12             $(document).ready(function(){
13                 $("#comments_form").ajaxForm({
14                     target: '#display_comments_div'
15                 });
16             
17                 // Bind the add button
18                     $("#add_button").click(function() {
19                       document.getElementById("add_button_div").style.display = 'none';
20                       document.getElementById("add_comments_div").style.display = 'block';
21                     });
22                     
23                     function hideEditor() {
24                   document.getElementById("add_button_div").style.display = 'block';
25                   document.getElementById("add_comments_div").style.display = 'none';
26                   document.getElementById(currentRTE).contentDocument.body.innerHTML='';    //clean input area
27                   document.getElementById("commentTitle").value='';
28                 }
29                     
30                     // Bind the cancel button
31                     $("#cancel_button").click(hideEditor);
32                     
33                     // Bind the submit button
34                 $('#comments_form').on('submit', hideEditor);
35             });
36         </script>
37         
38         <div id="add_button_div">
39           <table width="100%" cellpadding="0" cellspacing="0" border="0" class="attribute">
40             <tr>
41               <td width="20" height="20" align="center">
42                 <img id="add_button" src="<s:url value="/skin/icon.add.png"/>" onMouseOver=this.src="<s:url value="/skin/icon.addhot.png"/>"
43                     onMouseOut=this.src="<s:url value="/skin/icon.add.png"/>" title="<s:text name="tooltip.addcomment"/>"/>
44                </td>
45               <td>&nbsp;</td>
46             </tr>
47           </table>  
48         </div>
49         
50         <div id="add_comments_div" style="display: none;">
51         <form name="comments_form" id="comments_form" action="create-stepComment" method="post">
52           <table width="100%" cellpadding="0" cellspacing="0" border="0" class="attribute">
53             <tr valign="top">
54               <td width="20" height="20" align="center">
55                 <img id="cancel_button" src="<s:url value="/skin/icon.undo.png"/>"
56                     title="<s:text name="tooltip.cancel"/>" />
57               </td>
58               <td>
59             <input type="text" name="commentTitle" id="commentTitle">
60                 <script language='JavaScript'>
61                     displayTextEditor('commentValue', '', 650, 150);
62                 </script>   
63               </td>
64             </tr>
65           </table> 
66         </form>
67         </div>
68 </s:if>