Widen input element
[infodrom.org/service.infodrom.org] / src / InfoCon / sprit / index.wml
1 #include <infocon.style>
2
3 <future>
4 <page func=InfoCon title="Tankbuch">
5 <style type="text/css">
6 .jsaction {
7     color: #999;
8 }
9 label {
10     display: block;
11 }
12 </style>
13
14 <ul id="machines">
15 </ul>
16 <a class="jsaction" href="#" onclick="return machine_new()">Neues Fahrzeug</a>
17
18 <div id="details" style="margin-top: 5px;display:none;">
19 <input type="hidden" id="id" name="id" value="">
20 <label for="name">Name</label>
21 <input type="text" id="name" name="name" size="30">
22 <br>
23 <input type="submit" onclick="return machine_new_save()" value="Speichern">
24 &nbsp;&nbsp;&nbsp;
25 <input type="submit" onclick="$('#details').hide();return false" value="Abbrechen">
26 </div>
27
28 </page>
29 <protect>
30 <script type="text/javascript">
31 $(function(){
32     load_machines();
33 });
34
35 function load_machines()
36 {
37     $.invoke('SpritMachine/List');
38 }
39
40 function machine_new()
41 {
42     $('#details input').not('input[type="submit"]').val('');
43     $('#details').show();
44     return false;
45 }
46
47 function machine_new_save()
48 {
49     $.invoke('SpritMachine/Save', $('#details input').serialize(), function(data){
50         load_machines();
51         $('#details').hide();
52     });
53
54     return false;
55 }
56
57 function machine_list(obj)
58 {
59     $(obj).parents('form:first').get(0).submit();
60 }
61
62 </script>
63 </protect>
64