Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
304:6c22e0506587 | 307:be2660b6e40a |
---|---|
1 ///<reference path='../../../Platforms/Wasm/wasm-application-runner.ts'/> | 1 ///<reference path='../../../Platforms/Wasm/wasm-application-runner.ts'/> |
2 | 2 |
3 InitializeWasmApplication("OrthancStoneSimpleViewer", "/orthanc"); | 3 InitializeWasmApplication("OrthancStoneSimpleViewer", "/orthanc"); |
4 | 4 |
5 function SelectTool(toolName: string) { | 5 function SelectTool(toolName: string) { |
6 SendMessageToStoneApplication("select-tool:" + toolName); | 6 var command = { |
7 command: "selectTool", | |
8 args: { | |
9 toolName: toolName | |
10 } | |
11 }; | |
12 SendMessageToStoneApplication(JSON.stringify(command)); | |
13 | |
7 } | 14 } |
8 | 15 |
9 function PerformAction(actionName: string) { | 16 function PerformAction(commandName: string) { |
10 SendMessageToStoneApplication("perform-action:" + actionName); | 17 var command = { |
18 command: commandName, | |
19 commandType: "simple", | |
20 args: {} | |
21 }; | |
22 SendMessageToStoneApplication(JSON.stringify(command)); | |
11 } | 23 } |
12 | 24 |
13 //initializes the buttons | 25 //initializes the buttons |
14 //----------------------- | 26 //----------------------- |
15 // install "SelectTool" handlers | 27 // install "SelectTool" handlers |