comparison OrthancExplorer/explorer.js @ 1232:f1c01451a8ee

Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Dec 2014 17:04:40 +0100
parents 2e11c3353356
children 72d1c2fc0edb
comparison
equal deleted inserted replaced
1231:703fcd797186 1232:f1c01451a8ee
1021 1021
1022 $('#patient-anonymize').live('click', function() { 1022 $('#patient-anonymize').live('click', function() {
1023 OpenAnonymizeResourceDialog('../patients/' + $.mobile.pageData.uuid, 1023 OpenAnonymizeResourceDialog('../patients/' + $.mobile.pageData.uuid,
1024 'Anonymize this patient?'); 1024 'Anonymize this patient?');
1025 }); 1025 });
1026
1027
1028 $('#plugins').live('pagebeforeshow', function() {
1029 $.ajax({
1030 url: '../plugins',
1031 dataType: 'json',
1032 async: false,
1033 cache: false,
1034 success: function(plugins) {
1035 var target = $('#all-plugins');
1036 $('li', target).remove();
1037
1038 plugins.map(function(id) {
1039 return $.ajax({
1040 url: '../plugins/' + id,
1041 dataType: 'json',
1042 async: false,
1043 cache: false,
1044 success: function(plugin) {
1045 var li = $('<li>');
1046 var item = li;
1047
1048 if ('RootUri' in plugin)
1049 {
1050 item = $('<a>');
1051 li.append(item);
1052 item.click(function() {
1053 window.open(plugin.RootUri);
1054 });
1055 }
1056
1057 item.append($('<h1>').text(plugin.ID));
1058 item.append($('<p>').text(plugin.Description));
1059 item.append($('<span>').addClass('ui-li-count').text(plugin.Version));
1060 target.append(li);
1061 }
1062 });
1063 });
1064
1065 target.listview('refresh');
1066 }
1067 });
1068 });