# HG changeset patch # User Sebastien Jodogne # Date 1606466866 -3600 # Node ID c2802561d7f9696b5b158e096e9bc13bf5896ac6 # Parent 5726528039295f32b52d2f164a4b1b2126c1977c "PrintEnabled" configuration option diff -r 572652803929 -r c2802561d7f9 Applications/StoneWebViewer/WebApplication/app.js --- a/Applications/StoneWebViewer/WebApplication/app.js Fri Nov 27 09:34:02 2020 +0100 +++ b/Applications/StoneWebViewer/WebApplication/app.js Fri Nov 27 09:47:46 2020 +0100 @@ -31,8 +31,6 @@ // Registry of the PDF series for which the instance metadata is still waiting var pendingSeriesPdf_ = {}; -var globalConfiguration_ = {}; - function getParameterFromUrl(key) { var url = window.location.search.substring(1); @@ -266,6 +264,7 @@ showInfo: true, showReferenceLines: true, synchronizedBrowsing: false, + globalConfiguration: {}, modalWarning: false, modalNotDiagnostic: false, @@ -838,8 +837,9 @@ axios.get(CONFIGURATION_SOURCE) .then(function(response) { - globalConfiguration_ = ParseJsonWithComments(response.data); - + app.globalConfiguration = ParseJsonWithComments(response.data); + console.log(app.globalConfiguration); + // Option 1: Loading script using plain HTML /* @@ -882,7 +882,7 @@ window.addEventListener('message', function(e) { if ('type' in e.data) { - var expectedOrigin = globalConfiguration_['ExpectedMessageOrigin']; + var expectedOrigin = app.globalConfiguration['ExpectedMessageOrigin']; if (expectedOrigin === undefined) { alert('Dynamic actions are disabled in the Stone Web viewer, ' + diff -r 572652803929 -r c2802561d7f9 Applications/StoneWebViewer/WebApplication/configuration.json --- a/Applications/StoneWebViewer/WebApplication/configuration.json Fri Nov 27 09:34:02 2020 +0100 +++ b/Applications/StoneWebViewer/WebApplication/configuration.json Fri Nov 27 09:47:46 2020 +0100 @@ -1,5 +1,10 @@ { /** + * Enables/disables the print button. + **/ + "PrintEnabled" : true, + + /** * The allowed origin for messages corresponding to dynamic actions * triggered by another Web page using "window.postMessage()". The * special value "*" will allow any origin, which is an insecure diff -r 572652803929 -r c2802561d7f9 Applications/StoneWebViewer/WebApplication/index.html --- a/Applications/StoneWebViewer/WebApplication/index.html Fri Nov 27 09:34:02 2020 +0100 +++ b/Applications/StoneWebViewer/WebApplication/index.html Fri Nov 27 09:47:46 2020 +0100 @@ -472,7 +472,7 @@ -
+