comparison Applications/StoneWebViewer/WebApplication/app.js @ 1611:787db80a5a1b

new class MacroLayerRenderer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Oct 2020 18:02:03 +0100
parents 595c0952ef7e
children 5f0660fe06c3
comparison
equal deleted inserted replaced
1610:b7630b1a0253 1611:787db80a5a1b
722 alert('Bad origin for the message'); 722 alert('Bad origin for the message');
723 return; 723 return;
724 } 724 }
725 725
726 if (e.data.type == 'show-osirix-annotations') { 726 if (e.data.type == 'show-osirix-annotations') {
727 app.LoadOsiriXAnnotations(e.data.xml, true /* clear previous annotations */); 727 var clear = true; // Whether to clear previous annotations
728 if ('clear' in e.data) {
729 clear = e.data.clear;
730 }
731
732 app.LoadOsiriXAnnotations(e.data.xml, clear);
728 } else { 733 } else {
729 alert('Unknown message type: ' + e.data.type); 734 alert('Unknown message type: ' + e.data.type);
730 } 735 }
731 }); 736 });
732 737
741 //var targetOrigin = 'http://localhost:8000'; 746 //var targetOrigin = 'http://localhost:8000';
742 var targetOrigin = '*'; // TODO - INSECURE 747 var targetOrigin = '*'; // TODO - INSECURE
743 748
744 window.postMessage({ 749 window.postMessage({
745 'type': 'show-osirix-annotations', 750 'type': 'show-osirix-annotations',
746 'xml': response.data 751 'xml': response.data,
752 'clear': true
747 }, targetOrigin); 753 }, targetOrigin);
748 }); 754 });
749 } 755 }
750 } 756 }