Mercurial > hg > orthanc-stone
diff Applications/Samples/Web/simple-viewer.ts @ 307:be2660b6e40a am-callable-and-promise
wip: commands + status update
author | am@osimis.io |
---|---|
date | Tue, 25 Sep 2018 15:14:53 +0200 |
parents | 2038d76bf13f |
children |
line wrap: on
line diff
--- a/Applications/Samples/Web/simple-viewer.ts Tue Sep 18 18:20:10 2018 +0200 +++ b/Applications/Samples/Web/simple-viewer.ts Tue Sep 25 15:14:53 2018 +0200 @@ -3,11 +3,23 @@ InitializeWasmApplication("OrthancStoneSimpleViewer", "/orthanc"); function SelectTool(toolName: string) { - SendMessageToStoneApplication("select-tool:" + toolName); + var command = { + command: "selectTool", + args: { + toolName: toolName + } + }; + SendMessageToStoneApplication(JSON.stringify(command)); + } -function PerformAction(actionName: string) { - SendMessageToStoneApplication("perform-action:" + actionName); +function PerformAction(commandName: string) { + var command = { + command: commandName, + commandType: "simple", + args: {} + }; + SendMessageToStoneApplication(JSON.stringify(command)); } //initializes the buttons