]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/WebContent/jsp/descriptionPane.jsp
Salome HOME
jQuery UI datepicker is applied to date input fields in the study search form.
[tools/siman.git] / Workspace / Siman / WebContent / jsp / descriptionPane.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_description_div">
7     <tiles:insertAttribute name="display_description_pane" ignore="true" />
8 </div>
9
10 <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
11     <script type="text/javascript">
12         $(document).ready(function(){        
13             $("#description_form").ajaxForm({
14                 target: '#display_description_div'
15             });
16         
17             // Bind the add button
18             $("#set_description_button").click(function() {
19               document.getElementById("display_description_div").style.display = 'none';
20               document.getElementById("set_description_button_div").style.display = 'none';
21               document.getElementById("description_editor_div").style.display = 'block';
22               document.getElementById("descriptionValue").contentDocument.body.innerHTML = 
23                     document.getElementById("display_description_div").innerHTML;
24             });
25             
26             function hideDescriptionEditor() {
27               document.getElementById("display_description_div").style.display = 'block';
28               document.getElementById("set_description_button_div").style.display = 'block';
29               document.getElementById("description_editor_div").style.display = 'none';
30               document.getElementById('descriptionValue').contentDocument.body.innerHTML = '';
31             }
32             
33             // Bind the cancel button
34             $("#cancel_set_description_button").click(hideDescriptionEditor);
35             
36             // Bind the submit event
37             $('#description_form').on('submit', hideDescriptionEditor);
38         });
39     </script>
40     
41     <div id="set_description_button_div">
42       <table width="100%" cellpadding="0" cellspacing="0" border="0" class="attribute">
43         <tr>
44           <td width="20" height="20" align="center">
45             <img id="set_description_button" src="<s:url value="/skin/icon.add.png"/>" onMouseOver=this.src="<s:url value="/skin/icon.addhot.png"/>"
46                 onMouseOut=this.src="<s:url value="/skin/icon.add.png"/>" title="<s:text name="tooltip.adddescription"/>"/>
47            </td>
48           <td>&nbsp;</td>
49         </tr>
50       </table>  
51     </div>
52     
53     <div id="description_editor_div" style="display: none;">
54     <form name="description_form" id="description_form" action="set-description" method="post">
55       <table width="100%" cellpadding="0" cellspacing="0" border="0" class="attribute">
56         <tr valign="top">
57           <td width="20" height="20" align="center">
58             <img id="cancel_set_description_button" src="<s:url value="/skin/icon.undo.png"/>"
59                 title="<s:text name="tooltip.cancel"/>" />
60           </td>
61           <td>
62             <script language='JavaScript'>
63                 displayTextEditor('descriptionValue', '', 300, 150);
64             </script>   
65           </td>
66         </tr>
67       </table> 
68     </form>
69     </div>
70 </s:if>