Mercurial > hg > orthanc-stone
comparison Applications/Samples/Web/simple-viewer-single-file.ts @ 466:5055031f4a06 bgo-commands-codegen
- Added browserify to build. This allows using require calls for modules that
work with tsc compiler.
- removed older stuff related to Protocol Buffers and Flatbuffers
- changed triple-slash references to import statements
- module prefixes are now added at call sites
- added cmake module for filename handling
- switched to Ninja for sample build
- Added virtual dtor in ICommand
author | bgo-osimis |
---|---|
date | Mon, 11 Feb 2019 16:00:04 +0100 |
parents | 612238b3f3e8 |
children | 7105a0bad250 |
comparison
equal
deleted
inserted
replaced
448:cc47e6eaefb0 | 466:5055031f4a06 |
---|---|
1 ///<reference path='../../../Platforms/Wasm/wasm-application-runner.ts'/> | 1 import wasmApplicationRunner = require('../../../Platforms/Wasm/wasm-application-runner'); |
2 | 2 |
3 InitializeWasmApplication("OrthancStoneSimpleViewerSingleFile", "/orthanc"); | 3 wasmApplicationRunner.InitializeWasmApplication("OrthancStoneSimpleViewerSingleFile", "/orthanc"); |
4 | 4 |
5 function SelectTool(toolName: string) { | 5 function SelectTool(toolName: string) { |
6 var command = { | 6 var command = { |
7 command: "selectTool", | 7 command: "selectTool", |
8 args: { | 8 args: { |
9 toolName: toolName | 9 toolName: toolName |
10 } | 10 } |
11 }; | 11 }; |
12 SendMessageToStoneApplication(JSON.stringify(command)); | 12 wasmApplicationRunner.SendMessageToStoneApplication(JSON.stringify(command)); |
13 | 13 |
14 } | 14 } |
15 | 15 |
16 function PerformAction(commandName: string) { | 16 function PerformAction(commandName: string) { |
17 var command = { | 17 var command = { |
18 command: commandName, | 18 command: commandName, |
19 commandType: "simple", | 19 commandType: "simple", |
20 args: {} | 20 args: {} |
21 }; | 21 }; |
22 SendMessageToStoneApplication(JSON.stringify(command)); | 22 wasmApplicationRunner.SendMessageToStoneApplication(JSON.stringify(command)); |
23 } | 23 } |
24 | 24 |
25 //initializes the buttons | 25 //initializes the buttons |
26 //----------------------- | 26 //----------------------- |
27 // install "SelectTool" handlers | 27 // install "SelectTool" handlers |