From 63fd65690cba450721870a6222e0fb3ad71bb291 Mon Sep 17 00:00:00 2001 From: Steve Pieper Date: Fri, 15 May 2020 14:55:54 -0400 Subject: [PATCH] feat: expose some app internals as window.app (#1735) * feat: expose some app internals as window.app This can help developers explore and access some internal functionaltiy for debugging in the console. For example, this command can download the currently viewed study: ohif.app.commandsManager.runCommand("downloadAndZip", {listOfUIDs: [window.location.href.split("/").pop()]}) TODO: collect this example and other handy functions on a wiki page Co-authored-by: dannyrb * fix: typo in window.ohif.app assignment Co-authored-by: dannyrb --- platform/viewer/src/App.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/viewer/src/App.js b/platform/viewer/src/App.js index 4c3373500..47d869c9d 100644 --- a/platform/viewer/src/App.js +++ b/platform/viewer/src/App.js @@ -71,6 +71,14 @@ let extensionManager; // TODO[react] Use a provider when the whole tree is React window.store = store; +window.ohif = window.ohif || {}; +window.ohif.app = { + commandsManager, + hotkeysManager, + servicesManager, + extensionManager, +}; + class App extends Component { static propTypes = { config: PropTypes.oneOfType([