diff StoneWebViewer/Plugin/OrthancExplorer.js @ 1495:fb74ed5d8c22

initial commit of the Stone Web viewer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Jun 2020 16:51:10 +0200
parents
children 22d1bd085c19
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/StoneWebViewer/Plugin/OrthancExplorer.js	Thu Jun 25 16:51:10 2020 +0200
@@ -0,0 +1,57 @@
+$('#study').live('pagebeforecreate', function() {
+  var b = $('<a>')
+      .attr('data-role', 'button')
+      .attr('href', '#')
+      .attr('data-icon', 'search')
+      .attr('data-theme', 'e')
+      .text('Stone Web Viewer');
+
+  b.insertBefore($('#study-delete').parent().parent());
+  b.click(function() {
+    if ($.mobile.pageData) {
+      $.ajax({
+        url: '../studies/' + $.mobile.pageData.uuid,
+        dataType: 'json',
+        cache: false,
+        success: function(study) {
+          var studyInstanceUid = study.MainDicomTags.StudyInstanceUID;
+          window.open('../stone-webviewer/index.html?study=' + studyInstanceUid);
+        }
+      });      
+    }
+  });
+});
+
+
+$('#series').live('pagebeforecreate', function() {
+  var b = $('<a>')
+      .attr('data-role', 'button')
+      .attr('href', '#')
+      .attr('data-icon', 'search')
+      .attr('data-theme', 'e')
+      .text('Stone Web Viewer');
+
+  b.insertBefore($('#series-delete').parent().parent());
+  b.click(function() {
+    if ($.mobile.pageData) {
+      $.ajax({
+        url: '../series/' + $.mobile.pageData.uuid,
+        dataType: 'json',
+        cache: false,
+        success: function(series) {
+          $.ajax({
+            url: '../studies/' + series.ParentStudy,
+            dataType: 'json',
+            cache: false,
+            success: function(study) {
+              var studyInstanceUid = study.MainDicomTags.StudyInstanceUID;
+              var seriesInstanceUid = series.MainDicomTags.SeriesInstanceUID;
+              window.open('../stone-webviewer/index.html?study=' + studyInstanceUid +
+                          '&series=' + seriesInstanceUid);
+            }
+          });      
+        }
+      });      
+    }
+  });
+});