diff Applications/StoneWebViewer/WebApplication/app.js @ 1707:ee2b5990dfff

remove annoying alert box in the server demo
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 27 Nov 2020 18:44:41 +0100
parents 432172b49de4
children 2931f5e15320
line wrap: on
line diff
--- a/Applications/StoneWebViewer/WebApplication/app.js	Fri Nov 27 18:26:07 2020 +0100
+++ b/Applications/StoneWebViewer/WebApplication/app.js	Fri Nov 27 18:44:41 2020 +0100
@@ -1072,7 +1072,8 @@
 
 
 window.addEventListener('message', function(e) {
-  if ('type' in e.data) {
+  if ('type' in e.data &&
+      (e.data.type == 'show-osirix-annotations')) {
     var expectedOrigin = app.globalConfiguration['ExpectedMessageOrigin'];
     
     if (expectedOrigin === undefined) {
@@ -1092,8 +1093,8 @@
       
       app.LoadOsiriXAnnotations(e.data.xml, clear);
     }
-    else {
-      alert('Unknown type of dynamic action in the Stone Web viewer: ' + e.data.type);
-    }
+  }
+  else {
+    console.log('Unknown type of dynamic action in the Stone Web viewer: ' + e.data.type);
   }
 });