Wiki source code of GWTPropEditor

Last modified by Eugen Colesnicov on 2011/01/12 13:19

Show last authors
1 {pre}
2 #set($xbaseurl = $xwiki.getAttachmentURL('GWT.GWTPropEditor',"gwtpropeditor.zip"))
3 <meta name='gwt:module' content='$xbaseurl/com.xpn.xwiki.gwt.api.Api'>
4 <meta name="gwt:property" content="translations=GWT.GWTPropEditorTranslations">
5 <script language="javascript" src="$xbaseurl/gwt.js"></script>
6 <style type="text/css">
7 .xwikigwt-editfield, .tk-ModalDialog {
8 background-color: #ffffff;
9 border: 1px solid grey;
10 }
11 .xwikigwt-editfield-actions {
12 margin-top: 10px;
13 }
14 .editfield-invitation {
15 margin-bottom: 10px;
16 }
17 .Caption {
18 background-color: #FF7700;
19 padding: 4px;
20 padding-left: 20px;
21 color: #FFFFFF;
22 font-size: 1.1em;
23 font-weight: bolder;
24 }
25 .tk-ModalDialog-content {
26 padding: 20px;
27 }
28 </style>
29 {/pre}
30
31 #macro(display $itemdoc $classname $propname $addtext)
32 <td>
33 #display2($itemdoc $classname $propname $addtext)
34 </td>
35 #end
36
37 #macro(display2 $itemdoc $classname $propname $addtext)
38 #if($counter)
39 #set($counter = $counter + 1)
40 #else
41 #set($counter = 0)
42 #end
43 {pre}
44 <script>
45 var ei_${counter};
46 function cb_${counter}(value) { if (ei_${counter}) { ei_${counter}.innerHTML = value; }}
47 function go_${counter}(sid) { ei_${counter} = sid; editProperty("$itemdoc.fullName", "$classname", "$propname", cb_${counter}); }
48 </script>
49 {/pre}
50 #set($ok = $itemdoc.use($classname))
51 #set($value = $itemdoc.display($propname))
52 #if($value=="")
53 #set($value = "Enter a value")
54 #end
55 <span style="cursor: pointer;" onclick="go_${counter}(this)">$value</span> $addtext
56 #end