Mercurial > hg > orthanc
comparison OrthancExplorer/explorer.js @ 274:f2286c741109
patient protection in Orthanc Explorer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 08 Dec 2012 22:48:53 +0100 |
parents | f23318b11b39 |
children | cd6749e53a03 |
comparison
equal
deleted
inserted
replaced
273:d384af918264 | 274:f2286c741109 |
---|---|
376 | 376 |
377 target.append(FormatStudy(studies[i], '#study?uuid=' + studies[i].ID)); | 377 target.append(FormatStudy(studies[i], '#study?uuid=' + studies[i].ID)); |
378 } | 378 } |
379 | 379 |
380 target.listview('refresh'); | 380 target.listview('refresh'); |
381 | |
382 // Check whether this patient is protected | |
383 $.ajax({ | |
384 url: '../patients/' + $.mobile.pageData.uuid + '/protected', | |
385 type: 'GET', | |
386 dataType: 'text', | |
387 async: false, | |
388 success: function (s) { | |
389 var v = (s == '1') ? 'on' : 'off'; | |
390 $('#protection').val(v).slider('refresh'); | |
391 } | |
392 }); | |
381 }); | 393 }); |
382 }); | 394 }); |
383 } | 395 } |
384 }); | 396 }); |
385 | 397 |
784 $('#series-archive').live('click', function(e) { | 796 $('#series-archive').live('click', function(e) { |
785 e.preventDefault(); //stop the browser from following | 797 e.preventDefault(); //stop the browser from following |
786 window.location.href = '../series/' + $.mobile.pageData.uuid + '/archive'; | 798 window.location.href = '../series/' + $.mobile.pageData.uuid + '/archive'; |
787 }); | 799 }); |
788 | 800 |
801 $('#protection').live('change', function(e) { | |
802 var isProtected = e.target.value == "on"; | |
803 $.ajax({ | |
804 url: '../patients/' + $.mobile.pageData.uuid + '/protected', | |
805 type: 'PUT', | |
806 dataType: 'text', | |
807 data: isProtected ? '1' : '0', | |
808 async: false | |
809 }); | |
810 }); |