Mercurial > hg > orthanc
annotate OrthancExplorer/explorer.js @ 1591:cd9d99fe32e9
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 27 Aug 2015 10:54:52 +0200 |
parents | b8dc2f855a83 |
children | 5cdea1cd2071 |
rev | line source |
---|---|
0 | 1 // http://stackoverflow.com/questions/1663741/is-there-a-good-jquery-drag-and-drop-file-upload-plugin |
2 | |
3 | |
4 // Forbid the access to IE | |
5 if ($.browser.msie) | |
6 { | |
7 alert("Please use Mozilla Firefox or Google Chrome. Microsoft Internet Explorer is not supported."); | |
8 } | |
9 | |
10 // http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig.html | |
11 //$.mobile.ajaxEnabled = false; | |
12 //$.mobile.page.prototype.options.addBackBtn = true; | |
13 //$.mobile.defaultPageTransition = 'slide'; | |
14 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
15 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
16 var currentPage = ''; |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
17 var currentUuid = ''; |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
18 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
19 |
0 | 20 // http://stackoverflow.com/a/4673436 |
21 String.prototype.format = function() { | |
22 var args = arguments; | |
23 return this.replace(/{(\d+)}/g, function(match, number) { | |
24 /*return typeof args[number] != 'undefined' | |
25 ? args[number] | |
26 : match;*/ | |
27 | |
28 return args[number]; | |
29 }); | |
30 }; | |
31 | |
32 | |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
33 function Refresh() |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
34 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
35 if (currentPage == 'patient') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
36 RefreshPatient(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
37 else if (currentPage == 'study') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
38 RefreshStudy(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
39 else if (currentPage == 'series') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
40 RefreshSeries(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
41 else if (currentPage == 'instance') |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
42 RefreshInstance(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
43 } |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
44 |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
45 |
0 | 46 $(document).ready(function() { |
47 var $tree = $('#dicom-tree'); | |
48 $tree.tree({ | |
49 autoEscape: false | |
50 }); | |
51 | |
52 $('#dicom-tree').bind( | |
53 'tree.click', | |
54 function(event) { | |
55 if (event.node.is_open) | |
56 $tree.tree('closeNode', event.node, true); | |
57 else | |
58 $tree.tree('openNode', event.node, true); | |
59 } | |
60 ); | |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
61 |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
62 currentPage = $.mobile.pageData.active; |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
63 currentUuid = $.mobile.pageData.uuid; |
1591 | 64 if (!(typeof currentPage === 'undefined') && |
65 !(typeof currentUuid === 'undefined') && | |
66 currentPage.length > 0 && | |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
67 currentUuid.length > 0) |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
68 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
69 Refresh(); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
70 } |
0 | 71 }); |
72 | |
73 | |
74 function SplitLongUid(s) | |
75 { | |
76 return '<span>' + s.substr(0, s.length / 2) + '</span> <span>' + s.substr(s.length / 2, s.length - s.length / 2) + '</span>'; | |
77 } | |
78 | |
79 | |
80 function ParseDicomDate(s) | |
81 { | |
82 y = parseInt(s.substr(0, 4), 10); | |
83 m = parseInt(s.substr(4, 2), 10) - 1; | |
84 d = parseInt(s.substr(6, 2), 10); | |
85 | |
86 if (y == null || m == null || d == null || | |
87 !isFinite(y) || !isFinite(m) || !isFinite(d)) | |
88 { | |
89 return null; | |
90 } | |
91 | |
92 if (y < 1900 || y > 2100 || | |
93 m < 0 || m >= 12 || | |
94 d <= 0 || d >= 32) | |
95 { | |
96 return null; | |
97 } | |
98 | |
99 return new Date(y, m, d); | |
100 } | |
101 | |
102 | |
103 function FormatDicomDate(s) | |
104 { | |
105 if (s == undefined) | |
106 return "No date"; | |
107 | |
108 var d = ParseDicomDate(s); | |
109 if (d == null) | |
110 return '?'; | |
111 else | |
112 return d.toString('dddd, MMMM d, yyyy'); | |
113 } | |
114 | |
115 | |
80 | 116 function Sort(arr, fieldExtractor, isInteger, reverse) |
0 | 117 { |
33 | 118 var defaultValue; |
119 if (isInteger) | |
120 defaultValue = 0; | |
121 else | |
122 defaultValue = ''; | |
123 | |
0 | 124 arr.sort(function(a, b) { |
80 | 125 var ta = fieldExtractor(a); |
126 var tb = fieldExtractor(b); | |
0 | 127 var order; |
128 | |
33 | 129 if (ta == undefined) |
130 ta = defaultValue; | |
131 | |
132 if (tb == undefined) | |
133 tb = defaultValue; | |
134 | |
0 | 135 if (isInteger) |
136 { | |
137 ta = parseInt(ta, 10); | |
138 tb = parseInt(tb, 10); | |
139 order = ta - tb; | |
140 } | |
141 else | |
142 { | |
143 if (ta < tb) | |
144 order = -1; | |
145 else if (ta > tb) | |
146 order = 1; | |
147 else | |
148 order = 0; | |
149 } | |
150 | |
151 if (reverse) | |
152 return -order; | |
153 else | |
154 return order; | |
155 }); | |
156 } | |
157 | |
158 | |
80 | 159 function SortOnDicomTag(arr, tag, isInteger, reverse) |
160 { | |
161 return Sort(arr, function(a) { | |
162 return a.MainDicomTags[tag]; | |
163 }, isInteger, reverse); | |
164 } | |
165 | |
166 | |
0 | 167 |
1345 | 168 function GetResource(uri, callback) |
0 | 169 { |
170 $.ajax({ | |
1345 | 171 url: '..' + uri, |
0 | 172 dataType: 'json', |
173 async: false, | |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
174 cache: false, |
0 | 175 success: function(s) { |
176 callback(s); | |
177 } | |
178 }); | |
179 } | |
180 | |
181 | |
182 function CompleteFormatting(s, link, isReverse) | |
183 { | |
184 if (link != null) | |
185 { | |
186 s = 'href="' + link + '">' + s + '</a>'; | |
187 | |
188 if (isReverse) | |
189 s = 'data-direction="reverse" '+ s; | |
190 | |
191 s = '<a ' + s; | |
192 } | |
193 | |
194 if (isReverse) | |
195 return '<li data-icon="back">' + s + '</li>'; | |
196 else | |
197 return '<li>' + s + '</li>'; | |
198 } | |
199 | |
200 | |
38 | 201 function FormatMainDicomTags(tags, tagsToIgnore) |
202 { | |
203 var s = ''; | |
204 | |
205 for (var i in tags) | |
206 { | |
207 if (tagsToIgnore.indexOf(i) == -1) | |
208 { | |
209 var v = tags[i]; | |
210 | |
40 | 211 if (i == "PatientBirthDate" || |
212 i == "StudyDate" || | |
213 i == "SeriesDate") | |
38 | 214 { |
215 v = FormatDicomDate(v); | |
216 } | |
40 | 217 else if (i == "DicomStudyInstanceUID" || |
218 i == "DicomSeriesInstanceUID") | |
38 | 219 { |
220 v = SplitLongUid(v); | |
221 } | |
222 | |
223 | |
224 s += ('<p>{0}: <strong>{1}</strong></p>').format(i, v); | |
225 } | |
226 } | |
227 | |
228 return s; | |
229 } | |
230 | |
0 | 231 |
232 function FormatPatient(patient, link, isReverse) | |
233 { | |
40 | 234 var s = ('<h3>{0}</h3>{1}' + |
235 '<span class="ui-li-count">{2}</span>' | |
0 | 236 ).format |
38 | 237 (patient.MainDicomTags.PatientName, |
40 | 238 FormatMainDicomTags(patient.MainDicomTags, [ |
239 "PatientName", | |
240 "OtherPatientIDs" | |
241 ]), | |
0 | 242 patient.Studies.length |
243 ); | |
244 | |
245 return CompleteFormatting(s, link, isReverse); | |
246 } | |
247 | |
248 | |
249 | |
250 function FormatStudy(study, link, isReverse) | |
251 { | |
40 | 252 var s = ('<h3>{0}</h3>{1}' + |
0 | 253 '<span class="ui-li-count">{2}</span>' |
254 ).format | |
255 (study.MainDicomTags.StudyDescription, | |
40 | 256 FormatMainDicomTags(study.MainDicomTags, [ |
257 "StudyDescription", | |
258 "StudyTime" | |
259 ]), | |
0 | 260 study.Series.length |
261 ); | |
262 | |
263 return CompleteFormatting(s, link, isReverse); | |
264 } | |
265 | |
266 | |
267 | |
268 function FormatSeries(series, link, isReverse) | |
269 { | |
80 | 270 var c; |
82 | 271 if (series.ExpectedNumberOfInstances == null || |
272 series.Instances.length == series.ExpectedNumberOfInstances) | |
80 | 273 { |
82 | 274 c = series.Instances.length; |
80 | 275 } |
276 else | |
277 { | |
278 c = series.Instances.length + '/' + series.ExpectedNumberOfInstances; | |
279 } | |
280 | |
281 var s = ('<h3>{0}</h3>' + | |
282 '<p><em>Status: <strong>{1}</strong></em></p>{2}' + | |
283 '<span class="ui-li-count">{3}</span>').format | |
0 | 284 (series.MainDicomTags.SeriesDescription, |
80 | 285 series.Status, |
40 | 286 FormatMainDicomTags(series.MainDicomTags, [ |
287 "SeriesDescription", | |
288 "SeriesTime", | |
41
c1097a676eca
better naming for preview images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
289 "Manufacturer", |
c1097a676eca
better naming for preview images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
40
diff
changeset
|
290 "ImagesInAcquisition", |
40 | 291 "SeriesDate" |
292 ]), | |
80 | 293 c |
0 | 294 ); |
295 | |
296 return CompleteFormatting(s, link, isReverse); | |
297 } | |
298 | |
299 | |
300 function FormatInstance(instance, link, isReverse) | |
301 { | |
40 | 302 var s = ('<h3>Instance {0}</h3>{1}').format |
80 | 303 (instance.IndexInSeries, |
40 | 304 FormatMainDicomTags(instance.MainDicomTags, [ |
305 "AcquisitionNumber", | |
306 "InstanceNumber", | |
307 "InstanceCreationDate", | |
308 "InstanceCreationTime" | |
309 ]) | |
0 | 310 ); |
311 | |
312 return CompleteFormatting(s, link, isReverse); | |
313 } | |
314 | |
315 | |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
316 $('[data-role="page"]').live('pagebeforeshow', function() { |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
317 $.ajax({ |
153 | 318 url: '../system', |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
319 dataType: 'json', |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
320 async: false, |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
321 cache: false, |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
322 success: function(s) { |
165 | 323 if (s.Name != "") { |
324 $('.orthanc-name').html('<a class="ui-link" href="explorer.html">' + s.Name + '</a> » '); | |
325 } | |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
326 } |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
327 }); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
328 }); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
329 |
0 | 330 |
331 | |
332 $('#find-patients').live('pagebeforeshow', function() { | |
1345 | 333 GetResource('/patients?expand', function(patients) { |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
334 var target = $('#all-patients'); |
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
335 $('li', target).remove(); |
0 | 336 |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
337 SortOnDicomTag(patients, 'PatientName', false, false); |
0 | 338 |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
339 for (var i = 0; i < patients.length; i++) { |
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
340 var p = FormatPatient(patients[i], '#patient?uuid=' + patients[i].ID); |
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
341 target.append(p); |
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
342 } |
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
343 |
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
344 target.listview('refresh'); |
1345 | 345 }); |
0 | 346 }); |
347 | |
348 | |
349 | |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
350 function SetupAnonymizedOrModifiedFrom(buttonSelector, resource, resourceType, field) |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
351 { |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
352 if (field in resource) |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
353 { |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
354 $(buttonSelector).closest('li').show(); |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
355 $(buttonSelector).click(function(e) { |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
356 window.location.assign('explorer.html#' + resourceType + '?uuid=' + resource[field]); |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
357 }); |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
358 } |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
359 else |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
360 { |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
361 $(buttonSelector).closest('li').hide(); |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
362 } |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
363 } |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
364 |
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
365 |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
366 |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
367 function RefreshPatient() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
368 { |
0 | 369 if ($.mobile.pageData) { |
1345 | 370 GetResource('/patients/' + $.mobile.pageData.uuid, function(patient) { |
371 GetResource('/patients/' + $.mobile.pageData.uuid + '/studies', function(studies) { | |
372 SortOnDicomTag(studies, 'StudyDate', false, true); | |
0 | 373 |
1345 | 374 $('#patient-info li').remove(); |
375 $('#patient-info') | |
376 .append('<li data-role="list-divider">Patient</li>') | |
377 .append(FormatPatient(patient)) | |
378 .listview('refresh'); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
379 |
1345 | 380 var target = $('#list-studies'); |
381 $('li', target).remove(); | |
382 | |
383 for (var i = 0; i < studies.length; i++) { | |
384 if (i == 0 || studies[i].MainDicomTags.StudyDate != studies[i - 1].MainDicomTags.StudyDate) | |
385 { | |
386 target.append('<li data-role="list-divider">{0}</li>'.format | |
387 (FormatDicomDate(studies[i].MainDicomTags.StudyDate))); | |
0 | 388 } |
389 | |
1345 | 390 target.append(FormatStudy(studies[i], '#study?uuid=' + studies[i].ID)); |
391 } | |
0 | 392 |
1345 | 393 SetupAnonymizedOrModifiedFrom('#patient-anonymized-from', patient, 'patient', 'AnonymizedFrom'); |
394 SetupAnonymizedOrModifiedFrom('#patient-modified-from', patient, 'patient', 'ModifiedFrom'); | |
395 | |
396 target.listview('refresh'); | |
274
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
397 |
1345 | 398 // Check whether this patient is protected |
399 $.ajax({ | |
400 url: '../patients/' + $.mobile.pageData.uuid + '/protected', | |
401 type: 'GET', | |
402 dataType: 'text', | |
403 async: false, | |
404 cache: false, | |
405 success: function (s) { | |
406 var v = (s == '1') ? 'on' : 'off'; | |
407 $('#protection').val(v).slider('refresh'); | |
408 } | |
409 }); | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
410 |
1345 | 411 currentPage = 'patient'; |
412 currentUuid = $.mobile.pageData.uuid; | |
0 | 413 }); |
414 }); | |
415 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
416 } |
0 | 417 |
418 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
419 function RefreshStudy() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
420 { |
0 | 421 if ($.mobile.pageData) { |
1345 | 422 GetResource('/studies/' + $.mobile.pageData.uuid, function(study) { |
423 GetResource('/patients/' + study.ParentPatient, function(patient) { | |
424 GetResource('/studies/' + $.mobile.pageData.uuid + '/series', function(series) { | |
425 SortOnDicomTag(series, 'SeriesDate', false, true); | |
0 | 426 |
1345 | 427 $('#study .patient-link').attr('href', '#patient?uuid=' + patient.ID); |
428 $('#study-info li').remove(); | |
429 $('#study-info') | |
430 .append('<li data-role="list-divider">Patient</li>') | |
431 .append(FormatPatient(patient, '#patient?uuid=' + patient.ID, true)) | |
432 .append('<li data-role="list-divider">Study</li>') | |
433 .append(FormatStudy(study)) | |
434 .listview('refresh'); | |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
435 |
1345 | 436 SetupAnonymizedOrModifiedFrom('#study-anonymized-from', study, 'study', 'AnonymizedFrom'); |
437 SetupAnonymizedOrModifiedFrom('#study-modified-from', study, 'study', 'ModifiedFrom'); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
438 |
1345 | 439 var target = $('#list-series'); |
440 $('li', target).remove(); | |
441 for (var i = 0; i < series.length; i++) { | |
442 if (i == 0 || series[i].MainDicomTags.SeriesDate != series[i - 1].MainDicomTags.SeriesDate) | |
443 { | |
444 target.append('<li data-role="list-divider">{0}</li>'.format | |
445 (FormatDicomDate(series[i].MainDicomTags.SeriesDate))); | |
0 | 446 } |
1345 | 447 target.append(FormatSeries(series[i], '#series?uuid=' + series[i].ID)); |
448 } | |
449 target.listview('refresh'); | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
450 |
1345 | 451 currentPage = 'study'; |
452 currentUuid = $.mobile.pageData.uuid; | |
0 | 453 }); |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
454 }); |
0 | 455 }); |
456 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
457 } |
0 | 458 |
459 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
460 function RefreshSeries() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
461 { |
0 | 462 if ($.mobile.pageData) { |
1345 | 463 GetResource('/series/' + $.mobile.pageData.uuid, function(series) { |
464 GetResource('/studies/' + series.ParentStudy, function(study) { | |
465 GetResource('/patients/' + study.ParentPatient, function(patient) { | |
466 GetResource('/series/' + $.mobile.pageData.uuid + '/instances', function(instances) { | |
467 Sort(instances, function(x) { return x.IndexInSeries; }, true, false); | |
0 | 468 |
1345 | 469 $('#series .patient-link').attr('href', '#patient?uuid=' + patient.ID); |
470 $('#series .study-link').attr('href', '#study?uuid=' + study.ID); | |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
471 |
1345 | 472 $('#series-info li').remove(); |
473 $('#series-info') | |
474 .append('<li data-role="list-divider">Patient</li>') | |
475 .append(FormatPatient(patient, '#patient?uuid=' + patient.ID, true)) | |
476 .append('<li data-role="list-divider">Study</li>') | |
477 .append(FormatStudy(study, '#study?uuid=' + study.ID, true)) | |
478 .append('<li data-role="list-divider">Series</li>') | |
479 .append(FormatSeries(series)) | |
480 .listview('refresh'); | |
0 | 481 |
1345 | 482 SetupAnonymizedOrModifiedFrom('#series-anonymized-from', series, 'series', 'AnonymizedFrom'); |
483 SetupAnonymizedOrModifiedFrom('#series-modified-from', series, 'series', 'ModifiedFrom'); | |
443
be93b666ed79
link anonymized to original resource in OrthancExplorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
405
diff
changeset
|
484 |
1345 | 485 var target = $('#list-instances'); |
486 $('li', target).remove(); | |
487 for (var i = 0; i < instances.length; i++) { | |
488 target.append(FormatInstance(instances[i], '#instance?uuid=' + instances[i].ID)); | |
489 } | |
490 target.listview('refresh'); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
491 |
1345 | 492 currentPage = 'series'; |
493 currentUuid = $.mobile.pageData.uuid; | |
0 | 494 }); |
495 }); | |
496 }); | |
497 }); | |
498 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
499 } |
0 | 500 |
501 | |
502 | |
503 function ConvertForTree(dicom) | |
504 { | |
505 var result = []; | |
506 | |
507 for (var i in dicom) { | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
508 if (dicom[i] != null) { |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
509 var label = i + '<span class="tag-name"> (<i>' + dicom[i]["Name"] + '</i>)</span>: '; |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
510 |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
511 if (dicom[i]["Type"] == 'String') |
0 | 512 { |
513 result.push({ | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
514 label: label + '<strong>' + dicom[i]["Value"] + '</strong>', |
0 | 515 children: [] |
516 }); | |
517 } | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
518 else if (dicom[i]["Type"] == 'TooLong') |
0 | 519 { |
520 result.push({ | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
521 label: label + '<i>Too long</i>', |
0 | 522 children: [] |
523 }); | |
524 } | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
525 else if (dicom[i]["Type"] == 'Null') |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
526 { |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
527 result.push({ |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
528 label: label + '<i>Null</i>', |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
529 children: [] |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
530 }); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
531 } |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
532 else if (dicom[i]["Type"] == 'Sequence') |
0 | 533 { |
534 var c = []; | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
535 for (var j = 0; j < dicom[i]["Value"].length; j++) { |
0 | 536 c.push({ |
537 label: 'Item ' + j, | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
538 children: ConvertForTree(dicom[i]["Value"][j]) |
0 | 539 }); |
540 } | |
541 | |
542 result.push({ | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
543 label: label + '[]', |
0 | 544 children: c |
545 }); | |
546 } | |
547 } | |
548 } | |
549 | |
550 return result; | |
551 } | |
552 | |
553 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
554 function RefreshInstance() |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
555 { |
0 | 556 if ($.mobile.pageData) { |
1345 | 557 GetResource('/instances/' + $.mobile.pageData.uuid, function(instance) { |
558 GetResource('/series/' + instance.ParentSeries, function(series) { | |
559 GetResource('/studies/' + series.ParentStudy, function(study) { | |
560 GetResource('/patients/' + study.ParentPatient, function(patient) { | |
152
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
561 |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
562 $('#instance .patient-link').attr('href', '#patient?uuid=' + patient.ID); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
563 $('#instance .study-link').attr('href', '#study?uuid=' + study.ID); |
4829c054751a
improved navigation in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
151
diff
changeset
|
564 $('#instance .series-link').attr('href', '#series?uuid=' + series.ID); |
0 | 565 |
566 $('#instance-info li').remove(); | |
567 $('#instance-info') | |
568 .append('<li data-role="list-divider">Patient</li>') | |
569 .append(FormatPatient(patient, '#patient?uuid=' + patient.ID, true)) | |
570 .append('<li data-role="list-divider">Study</li>') | |
571 .append(FormatStudy(study, '#study?uuid=' + study.ID, true)) | |
572 .append('<li data-role="list-divider">Series</li>') | |
573 .append(FormatSeries(series, '#series?uuid=' + series.ID, true)) | |
574 .append('<li data-role="list-divider">Instance</li>') | |
575 .append(FormatInstance(instance)) | |
576 .listview('refresh'); | |
577 | |
1345 | 578 GetResource('/instances/' + instance.ID + '/tags', function(s) { |
579 $('#dicom-tree').tree('loadData', ConvertForTree(s)); | |
0 | 580 }); |
581 | |
515
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
582 SetupAnonymizedOrModifiedFrom('#instance-anonymized-from', instance, 'instance', 'AnonymizedFrom'); |
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
583 SetupAnonymizedOrModifiedFrom('#instance-modified-from', instance, 'instance', 'ModifiedFrom'); |
a8be42bcf2bb
Link from modified to original resource in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
485
diff
changeset
|
584 |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
585 currentPage = 'instance'; |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
586 currentUuid = $.mobile.pageData.uuid; |
0 | 587 }); |
588 }); | |
589 }); | |
590 }); | |
591 } | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
592 } |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
593 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
594 $(document).live('pagebeforehide', function() { |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
595 currentPage = ''; |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
596 currentUuid = ''; |
0 | 597 }); |
598 | |
599 | |
600 | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
601 $('#patient').live('pagebeforeshow', RefreshPatient); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
602 $('#study').live('pagebeforeshow', RefreshStudy); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
603 $('#series').live('pagebeforeshow', RefreshSeries); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
604 $('#instance').live('pagebeforeshow', RefreshInstance); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
605 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
606 $(function() { |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
607 $(window).hashchange(function(e, data) { |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
608 // This fixes the navigation with the back button and with the anonymization |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
609 if ('uuid' in $.mobile.pageData && |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
610 currentPage == $.mobile.pageData.active && |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
611 currentUuid != $.mobile.pageData.uuid) { |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
612 Refresh(); |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
613 } |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
614 }); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
615 }); |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
616 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
617 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
618 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
619 |
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
620 |
0 | 621 function DeleteResource(path) |
622 { | |
623 $.ajax({ | |
624 url: path, | |
625 type: 'DELETE', | |
626 dataType: 'json', | |
627 async: false, | |
628 success: function(s) { | |
629 var ancestor = s.RemainingAncestor; | |
630 if (ancestor == null) | |
631 $.mobile.changePage('#find-patients'); | |
632 else | |
201
bee20e978835
refactoring of delete
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
165
diff
changeset
|
633 $.mobile.changePage('#' + ancestor.Type.toLowerCase() + '?uuid=' + ancestor.ID); |
0 | 634 } |
635 }); | |
636 } | |
637 | |
638 | |
639 | |
640 function OpenDeleteResourceDialog(path, title) | |
641 { | |
642 $(document).simpledialog2({ | |
643 // http://dev.jtsage.com/jQM-SimpleDialog/demos2/ | |
644 // http://dev.jtsage.com/jQM-SimpleDialog/demos2/options.html | |
645 mode: 'button', | |
646 animate: false, | |
647 headerText: title, | |
648 headerClose: true, | |
649 width: '500px', | |
650 buttons : { | |
651 'OK': { | |
652 click: function () { | |
653 DeleteResource(path); | |
654 }, | |
655 icon: "delete", | |
656 theme: "c" | |
657 }, | |
658 'Cancel': { | |
659 click: function () { | |
660 } | |
661 } | |
662 } | |
663 }); | |
664 } | |
665 | |
666 | |
667 | |
668 $('#instance-delete').live('click', function() { | |
83 | 669 OpenDeleteResourceDialog('../instances/' + $.mobile.pageData.uuid, |
0 | 670 'Delete this instance?'); |
671 }); | |
672 | |
673 $('#study-delete').live('click', function() { | |
83 | 674 OpenDeleteResourceDialog('../studies/' + $.mobile.pageData.uuid, |
0 | 675 'Delete this study?'); |
676 }); | |
677 | |
678 $('#series-delete').live('click', function() { | |
83 | 679 OpenDeleteResourceDialog('../series/' + $.mobile.pageData.uuid, |
0 | 680 'Delete this series?'); |
681 }); | |
682 | |
683 $('#patient-delete').live('click', function() { | |
83 | 684 OpenDeleteResourceDialog('../patients/' + $.mobile.pageData.uuid, |
0 | 685 'Delete this patient?'); |
686 }); | |
687 | |
688 | |
689 $('#instance-download-dicom').live('click', function(e) { | |
690 // http://stackoverflow.com/a/1296101 | |
691 e.preventDefault(); //stop the browser from following | |
83 | 692 window.location.href = '../instances/' + $.mobile.pageData.uuid + '/file'; |
0 | 693 }); |
694 | |
695 $('#instance-download-json').live('click', function(e) { | |
696 // http://stackoverflow.com/a/1296101 | |
697 e.preventDefault(); //stop the browser from following | |
83 | 698 window.location.href = '../instances/' + $.mobile.pageData.uuid + '/tags'; |
0 | 699 }); |
700 | |
701 | |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
702 |
0 | 703 $('#instance-preview').live('click', function(e) { |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
704 if ($.mobile.pageData) { |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
705 var pdf = '../instances/' + $.mobile.pageData.uuid + '/pdf'; |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
706 $.ajax({ |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
707 url: pdf, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
708 cache: false, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
709 success: function(s) { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
710 window.location.assign(pdf); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
711 }, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
712 error: function() { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
713 GetResource('/instances/' + $.mobile.pageData.uuid + '/frames', function(frames) { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
714 if (frames.length == 1) |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
715 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
716 // Viewing a single-frame image |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
717 jQuery.slimbox('../instances/' + $.mobile.pageData.uuid + '/preview', '', { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
718 overlayFadeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
719 resizeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
720 imageFadeDuration : 1 |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
721 }); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
722 } |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
723 else |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
724 { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
725 // Viewing a multi-frame image |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
726 |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
727 var images = []; |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
728 for (var i = 0; i < frames.length; i++) { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
729 images.push([ '../instances/' + $.mobile.pageData.uuid + '/frames/' + i + '/preview' ]); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
730 } |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
731 |
1556
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
732 jQuery.slimbox(images, 0, { |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
733 overlayFadeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
734 resizeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
735 imageFadeDuration : 1, |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
736 loop : true |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
737 }); |
b8dc2f855a83
Preview of PDF files encapsulated in DICOM from Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1345
diff
changeset
|
738 } |
54
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
739 }); |
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
740 } |
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
741 }); |
42a449dac415
multi-frame images in the explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
45
diff
changeset
|
742 } |
0 | 743 }); |
744 | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
745 |
1345 | 746 |
0 | 747 $('#series-preview').live('click', function(e) { |
748 if ($.mobile.pageData) { | |
1345 | 749 GetResource('/series/' + $.mobile.pageData.uuid, function(series) { |
750 GetResource('/series/' + $.mobile.pageData.uuid + '/instances', function(instances) { | |
751 Sort(instances, function(x) { return x.IndexInSeries; }, true, false); | |
0 | 752 |
1345 | 753 var images = []; |
754 for (var i = 0; i < instances.length; i++) { | |
755 images.push([ '../instances/' + instances[i].ID + '/preview', | |
756 '{0}/{1}'.format(i + 1, instances.length) ]) | |
757 } | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
758 |
1345 | 759 jQuery.slimbox(images, 0, { |
760 overlayFadeDuration : 1, | |
761 resizeDuration : 1, | |
762 imageFadeDuration : 1, | |
763 loop : true | |
764 }); | |
1343
72d1c2fc0edb
Huge speed-up in Orthanc Explorer for large amount of images
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1232
diff
changeset
|
765 }); |
0 | 766 }); |
767 } | |
768 }); | |
769 | |
770 | |
771 | |
772 | |
773 | |
774 function ChooseDicomModality(callback) | |
775 { | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
776 var clickedModality = ''; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
777 var clickedPeer = ''; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
778 var items = $('<ul>') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
779 .attr('data-divider-theme', 'd') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
780 .attr('data-role', 'listview'); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
781 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
782 // Retrieve the list of the known DICOM modalities |
0 | 783 $.ajax({ |
83 | 784 url: '../modalities', |
0 | 785 type: 'GET', |
786 dataType: 'json', | |
787 async: false, | |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
788 cache: false, |
0 | 789 success: function(modalities) { |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
790 if (modalities.length > 0) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
791 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
792 items.append('<li data-role="list-divider">DICOM modalities</li>'); |
484
b8ace6fc1d1f
preparation for handling Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
482
diff
changeset
|
793 |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
794 for (var i = 0; i < modalities.length; i++) { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
795 var name = modalities[i]; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
796 var item = $('<li>') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
797 .html('<a href="#" rel="close">' + name + '</a>') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
798 .attr('name', name) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
799 .click(function() { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
800 clickedModality = $(this).attr('name'); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
801 }); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
802 items.append(item); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
803 } |
0 | 804 } |
805 | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
806 // Retrieve the list of the known Orthanc peers |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
807 $.ajax({ |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
808 url: '../peers', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
809 type: 'GET', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
810 dataType: 'json', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
811 async: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
812 cache: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
813 success: function(peers) { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
814 if (peers.length > 0) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
815 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
816 items.append('<li data-role="list-divider">Orthanc peers</li>'); |
484
b8ace6fc1d1f
preparation for handling Orthanc peers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
482
diff
changeset
|
817 |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
818 for (var i = 0; i < peers.length; i++) { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
819 var name = peers[i]; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
820 var item = $('<li>') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
821 .html('<a href="#" rel="close">' + name + '</a>') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
822 .attr('name', name) |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
823 .click(function() { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
824 clickedPeer = $(this).attr('name'); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
825 }); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
826 items.append(item); |
0 | 827 } |
828 } | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
829 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
830 // Launch the dialog |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
831 $('#dialog').simpledialog2({ |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
832 mode: 'blank', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
833 animate: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
834 headerText: 'Choose target', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
835 headerClose: true, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
836 forceInput: false, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
837 width: '100%', |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
838 blankContent: items, |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
839 callbackClose: function() { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
840 var timer; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
841 function WaitForDialogToClose() { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
842 if (!$('#dialog').is(':visible')) { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
843 clearInterval(timer); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
844 callback(clickedModality, clickedPeer); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
845 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
846 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
847 timer = setInterval(WaitForDialogToClose, 100); |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
848 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
849 }); |
0 | 850 } |
851 }); | |
852 } | |
853 }); | |
854 } | |
855 | |
856 | |
405
97a00b30abcc
sending of studies and patients with orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
354
diff
changeset
|
857 $('#instance-store,#series-store,#study-store,#patient-store').live('click', function(e) { |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
858 ChooseDicomModality(function(modality, peer) { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
859 var url; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
860 var loading; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
861 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
862 if (modality != '') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
863 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
864 url = '../modalities/' + modality + '/store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
865 loading = '#dicom-store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
866 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
867 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
868 if (peer != '') |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
869 { |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
870 url = '../peers/' + peer + '/store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
871 loading = '#peer-store'; |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
872 } |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
873 |
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
874 if (url != '') { |
0 | 875 $.ajax({ |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
876 url: url, |
0 | 877 type: 'POST', |
878 dataType: 'text', | |
879 data: $.mobile.pageData.uuid, | |
880 async: true, // Necessary to block UI | |
881 beforeSend: function() { | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
882 $.blockUI({ message: $(loading) }); |
0 | 883 }, |
884 complete: function(s) { | |
885 $.unblockUI(); | |
886 }, | |
887 success: function(s) { | |
888 }, | |
889 error: function() { | |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
890 alert('Error during store'); |
0 | 891 } |
485
bdbde1fbfab3
send resources through HTTP
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
484
diff
changeset
|
892 }); |
0 | 893 } |
894 }); | |
895 }); | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
896 |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
897 |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
898 $('#show-tag-name').live('change', function(e) { |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
899 var checked = e.currentTarget.checked; |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
900 if (checked) |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
901 $('.tag-name').show(); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
902 else |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
903 $('.tag-name').hide(); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
904 }); |
250
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
905 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
906 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
907 $('#patient-archive').live('click', function(e) { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
908 e.preventDefault(); //stop the browser from following |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
909 window.location.href = '../patients/' + $.mobile.pageData.uuid + '/archive'; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
910 }); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
911 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
912 $('#study-archive').live('click', function(e) { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
913 e.preventDefault(); //stop the browser from following |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
914 window.location.href = '../studies/' + $.mobile.pageData.uuid + '/archive'; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
915 }); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
916 |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
917 $('#series-archive').live('click', function(e) { |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
918 e.preventDefault(); //stop the browser from following |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
919 window.location.href = '../series/' + $.mobile.pageData.uuid + '/archive'; |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
920 }); |
f23318b11b39
creation of zip files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
201
diff
changeset
|
921 |
1188
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
922 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
923 $('#patient-media').live('click', function(e) { |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
924 e.preventDefault(); //stop the browser from following |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
925 window.location.href = '../patients/' + $.mobile.pageData.uuid + '/media'; |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
926 }); |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
927 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
928 $('#study-media').live('click', function(e) { |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
929 e.preventDefault(); //stop the browser from following |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
930 window.location.href = '../studies/' + $.mobile.pageData.uuid + '/media'; |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
931 }); |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
932 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
933 $('#series-media').live('click', function(e) { |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
934 e.preventDefault(); //stop the browser from following |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
935 window.location.href = '../series/' + $.mobile.pageData.uuid + '/media'; |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
936 }); |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
937 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
938 |
2e11c3353356
download dicomdir in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
515
diff
changeset
|
939 |
274
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
940 $('#protection').live('change', function(e) { |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
941 var isProtected = e.target.value == "on"; |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
942 $.ajax({ |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
943 url: '../patients/' + $.mobile.pageData.uuid + '/protected', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
944 type: 'PUT', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
945 dataType: 'text', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
946 data: isProtected ? '1' : '0', |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
947 async: false |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
948 }); |
f2286c741109
patient protection in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
250
diff
changeset
|
949 }); |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
950 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
951 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
952 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
953 function OpenAnonymizeResourceDialog(path, title) |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
954 { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
955 $(document).simpledialog2({ |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
956 mode: 'button', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
957 animate: false, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
958 headerText: title, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
959 headerClose: true, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
960 width: '500px', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
961 buttons : { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
962 'OK': { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
963 click: function () { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
964 $.ajax({ |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
965 url: path + '/anonymize', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
966 type: 'POST', |
354 | 967 data: '{ "Keep" : [ "SeriesDescription", "StudyDescription" ] }', |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
968 dataType: 'json', |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
969 async: false, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
970 cache: false, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
971 success: function(s) { |
351 | 972 // The following line does not work... |
973 //$.mobile.changePage('explorer.html#patient?uuid=' + s.PatientID); | |
974 | |
975 window.location.assign('explorer.html#patient?uuid=' + s.PatientID); | |
482
b05eb8708aee
fix history in Orthanc Explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
443
diff
changeset
|
976 //window.location.reload(); |
344
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
977 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
978 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
979 }, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
980 icon: "delete", |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
981 theme: "c" |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
982 }, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
983 'Cancel': { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
984 click: function () { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
985 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
986 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
987 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
988 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
989 } |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
990 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
991 $('#instance-anonymize').live('click', function() { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
992 OpenAnonymizeResourceDialog('../instances/' + $.mobile.pageData.uuid, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
993 'Anonymize this instance?'); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
994 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
995 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
996 $('#study-anonymize').live('click', function() { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
997 OpenAnonymizeResourceDialog('../studies/' + $.mobile.pageData.uuid, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
998 'Anonymize this study?'); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
999 }); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1000 |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1001 $('#series-anonymize').live('click', function() { |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1002 OpenAnonymizeResourceDialog('../series/' + $.mobile.pageData.uuid, |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1003 'Anonymize this series?'); |
cd6749e53a03
anonymization from orthanc explorer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
274
diff
changeset
|
1004 }); |
351 | 1005 |
1006 $('#patient-anonymize').live('click', function() { | |
1007 OpenAnonymizeResourceDialog('../patients/' + $.mobile.pageData.uuid, | |
1008 'Anonymize this patient?'); | |
1009 }); | |
1232
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1010 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1011 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1012 $('#plugins').live('pagebeforeshow', function() { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1013 $.ajax({ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1014 url: '../plugins', |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1015 dataType: 'json', |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1016 async: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1017 cache: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1018 success: function(plugins) { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1019 var target = $('#all-plugins'); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1020 $('li', target).remove(); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1021 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1022 plugins.map(function(id) { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1023 return $.ajax({ |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1024 url: '../plugins/' + id, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1025 dataType: 'json', |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1026 async: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1027 cache: false, |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1028 success: function(plugin) { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1029 var li = $('<li>'); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1030 var item = li; |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1031 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1032 if ('RootUri' in plugin) |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1033 { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1034 item = $('<a>'); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1035 li.append(item); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1036 item.click(function() { |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1037 window.open(plugin.RootUri); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1038 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1039 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1040 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1041 item.append($('<h1>').text(plugin.ID)); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1042 item.append($('<p>').text(plugin.Description)); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1043 item.append($('<span>').addClass('ui-li-count').text(plugin.Version)); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1044 target.append(li); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1045 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1046 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1047 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1048 |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1049 target.listview('refresh'); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1050 } |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1051 }); |
f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1188
diff
changeset
|
1052 }); |