|
18 | 18 | p, div { |
19 | 19 | margin: 10px; |
20 | 20 | } |
21 | | - form { |
22 | | - display: inline; |
23 | | - } |
| 21 | + form { |
| 22 | + display: inline; |
| 23 | + } |
24 | 24 | </style> |
25 | 25 | <script src="jquery-1.6.1.min.js"></script> |
26 | 26 | <script> |
|
39 | 39 | <script src="Base64.js"></script> |
40 | 40 | <script> |
41 | 41 | var viewer; |
42 | | - function revisionUpdate(poid) { |
43 | | - $('#roids').empty(); |
44 | | - $.ajax({url: '/rest/getAllRevisionsOfProject', data: 'poid='+poid, dataType: 'json', success: function(data){ |
45 | | - var select = $('#roids'); |
46 | | - $.each(data.sRevision, function(i, revision){ |
47 | | - $('<option />').val(revision.oid).text(revision.id).appendTo(select); |
48 | | - }); |
49 | | - }}); |
50 | | - } |
51 | | - function projectUpdate() { |
52 | | - $('#revision').show(); |
53 | | - $('#poids').empty(); |
54 | | - $.ajax({url: '/rest/getAllProjects', dataType: 'json', success: function(data) { |
55 | | - var select = $('#poids'); |
56 | | - $.each( data.sProject, function(i, project) { |
57 | | - $('<option />').val(project.oid).text(project.name).appendTo(select); |
58 | | - }); |
59 | | - revisionUpdate(select.val()); |
60 | | - }}); |
61 | | - } |
| 42 | + function revisionUpdate(poid) { |
| 43 | + $('#roids').empty(); |
| 44 | + $.ajax({url: '/rest/getAllRevisionsOfProject', data: 'poid='+poid, dataType: 'json', success: function(data){ |
| 45 | + var select = $('#roids'); |
| 46 | + $.each(data.sRevision, function(i, revision){ |
| 47 | + $('<option />').val(revision.oid).text(revision.id).appendTo(select); |
| 48 | + }); |
| 49 | + }}); |
| 50 | + } |
| 51 | + function projectUpdate() { |
| 52 | + $('#revision').show(); |
| 53 | + $('#poids').empty(); |
| 54 | + $.ajax({url: '/rest/getAllProjects', dataType: 'json', success: function(data) { |
| 55 | + var select = $('#poids'); |
| 56 | + $.each( data.sProject, function(i, project) { |
| 57 | + $('<option />').val(project.oid).text(project.name).appendTo(select); |
| 58 | + }); |
| 59 | + revisionUpdate(select.val()); |
| 60 | + }}); |
| 61 | + } |
62 | 62 | $(document).ready(function() { |
63 | | - viewer = new ThreeJsViewer(); |
64 | | - viewer.init($('#viewerContainer')); |
65 | | - viewer.onClick = function(id) { |
66 | | - if (id==null) { |
67 | | - $('#selection').html('nothing'); |
68 | | - return; |
69 | | - } |
70 | | - $.ajax({ |
71 | | - url: '/rest/getDataObjectByGuid', |
72 | | - data: 'roid='+$('#roids').val()+'&guid='+id, |
73 | | - success: function(data){ |
74 | | - $('#selection').html(id + ' - ' + data.sDataObject.name + ' - ' + data.sDataObject.type); |
75 | | - } |
76 | | - }); |
77 | | - }; |
78 | | - viewer.animate(); |
| 63 | + viewer = new ThreeJsViewer(); |
| 64 | + viewer.init($('#viewerContainer')); |
| 65 | + viewer.onClick = function(id) { |
| 66 | + if (id==null) { |
| 67 | + $('#selection').html('nothing'); |
| 68 | + return; |
| 69 | + } |
| 70 | + $.ajax({ |
| 71 | + url: '/rest/getDataObjectByGuid', |
| 72 | + data: 'roid='+$('#roids').val()+'&guid='+id, |
| 73 | + success: function(data){ |
| 74 | + $('#selection').html(id + ' - ' + data.sDataObject.name + ' - ' + data.sDataObject.type); |
| 75 | + } |
| 76 | + }); |
| 77 | + }; |
| 78 | + viewer.animate(); |
79 | 79 | $('#login').submit(function() { |
80 | 80 | var username = $('#login input[name=username]').val(); |
81 | 81 | var password = $('#login input[name=password]').val(); |
|
85 | 85 | return false; |
86 | 86 | }); |
87 | 87 | $('#poids').change(function() { |
88 | | - revisionUpdate($(this).val()); |
| 88 | + revisionUpdate($(this).val()); |
| 89 | + }); |
| 90 | + $('#revision').submit(function(){ |
| 91 | + $.ajax({ |
| 92 | + url: '/rest/download', |
| 93 | + data: 'roid='+$(this.roids).val()+'&resultType=THREEJS', |
| 94 | + success: function(data) { |
| 95 | + viewer.clearModel(); |
| 96 | + viewer.loadModel('/download?longActionId=' + data); |
| 97 | + } |
| 98 | + }); |
| 99 | + return false; |
89 | 100 | }); |
90 | | - $('#revision').submit(function(){ |
91 | | - $.ajax({ |
92 | | - url: '/rest/download', |
93 | | - data: 'roid='+$(this.roids).val()+'&resultType=THREEJS', |
94 | | - success: function(data) { |
95 | | - viewer.clearModel(); |
96 | | - viewer.loadModel('/download?longActionId=' + data); |
97 | | - } |
98 | | - }); |
99 | | - return false; |
100 | | - }); |
101 | 101 | }); |
102 | 102 | </script> |
103 | 103 | </head> |
104 | 104 | <body> |
105 | 105 | <div> |
106 | 106 | <form id="login" class="boxed" style="margin-right: 20px;"> |
107 | 107 | User <input name="username" type="text" /> |
108 | | - PW <input name="password" type="password" /> |
| 108 | + PW <input name="password" type="password" /> |
109 | 109 | <input type="submit" value="Login"/> |
110 | 110 | </form> |
111 | 111 | <form id="revision" class="boxed" style="display: none;"> |
112 | 112 | <select id="poids"></select> |
113 | 113 | <select id="roids"></select> |
114 | | - <input type="submit" value="Show" /> |
| 114 | + <input type="submit" value="Show" /> |
115 | 115 | </form> |
116 | 116 | </div> |
117 | 117 | <div id="viewerContainer"></div> |
|
0 commit comments