changeset 2:c919d488471f

throbber to reflect the receiving of instances
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 26 Feb 2015 11:35:04 +0100
parents 828c61fc8253
children ca16691db433
files WebApplication/images/throbber.gif WebApplication/viewer.css WebApplication/viewer.html WebApplication/viewer.js
diffstat 4 files changed, 34 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file WebApplication/images/throbber.gif has changed
--- a/WebApplication/viewer.css	Thu Feb 26 10:26:51 2015 +0100
+++ b/WebApplication/viewer.css	Thu Feb 26 11:35:04 2015 +0100
@@ -78,6 +78,10 @@
     left: 10px; 
 }
 
+#topleft img {
+    vertical-align: middle;
+}
+
 #topright {
     position: absolute;
     top: 10px; 
--- a/WebApplication/viewer.html	Thu Feb 26 10:26:51 2015 +0100
+++ b/WebApplication/viewer.html	Thu Feb 26 11:35:04 2015 +0100
@@ -22,6 +22,10 @@
 
     <div id="topleft">
       <button id="open-toolbar"></button>
+      &nbsp;<img id="unstable" 
+                 style="display: none"
+                 src="images/throbber.gif" 
+                 title="Still receiving images for this series. Wait a bit, then refresh this page." />
     </div>
 
     <div id="topright">Render Time:</div>
--- a/WebApplication/viewer.js	Thu Feb 26 10:26:51 2015 +0100
+++ b/WebApplication/viewer.js	Thu Feb 26 11:35:04 2015 +0100
@@ -346,6 +346,8 @@
     text: false
   });
 
+  $('#unstable').tooltip();
+
   var series = window.url('?series', window.location.search);
   if (series == null)
     return;
@@ -382,6 +384,30 @@
   }
 
 
+  $.ajax({
+    type: 'GET',
+    url: '../../series/' + series,
+    dataType: 'json',
+    cache: false,
+    async: true,
+    success: function(series) {
+      var unstable = !series.IsStable;
+
+      if (unstable &&
+          'Status' in series &&
+          series.Status == 'Complete') {
+        // The series is not tagged as stable by Orthanc, but all the
+        // expected instances are already available.
+        unstable = false;
+      }
+
+      if (unstable) {
+        $('#unstable').show();
+      }
+    }
+  });
+  
+
   var currentImageIndex = 0;
 
   // updates the image display