comparison 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
comparison
equal deleted inserted replaced
1706:432172b49de4 1707:ee2b5990dfff
1070 // Disable the selection of text using the mouse 1070 // Disable the selection of text using the mouse
1071 document.onselectstart = new Function ('return false'); 1071 document.onselectstart = new Function ('return false');
1072 1072
1073 1073
1074 window.addEventListener('message', function(e) { 1074 window.addEventListener('message', function(e) {
1075 if ('type' in e.data) { 1075 if ('type' in e.data &&
1076 (e.data.type == 'show-osirix-annotations')) {
1076 var expectedOrigin = app.globalConfiguration['ExpectedMessageOrigin']; 1077 var expectedOrigin = app.globalConfiguration['ExpectedMessageOrigin'];
1077 1078
1078 if (expectedOrigin === undefined) { 1079 if (expectedOrigin === undefined) {
1079 alert('Dynamic actions are disabled in the Stone Web viewer, ' + 1080 alert('Dynamic actions are disabled in the Stone Web viewer, ' +
1080 'set the configuration option "ExpectedMessageOrigin".'); 1081 'set the configuration option "ExpectedMessageOrigin".');
1090 clear = e.data.clear; 1091 clear = e.data.clear;
1091 } 1092 }
1092 1093
1093 app.LoadOsiriXAnnotations(e.data.xml, clear); 1094 app.LoadOsiriXAnnotations(e.data.xml, clear);
1094 } 1095 }
1095 else { 1096 }
1096 alert('Unknown type of dynamic action in the Stone Web viewer: ' + e.data.type); 1097 else {
1097 } 1098 console.log('Unknown type of dynamic action in the Stone Web viewer: ' + e.data.type);
1098 } 1099 }
1099 }); 1100 });