init
This commit is contained in:
51
nv/html/dwv/viewers/simplistic/applauncher.js
Normal file
51
nv/html/dwv/viewers/simplistic/applauncher.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Application launcher.
|
||||
*/
|
||||
|
||||
// start app function
|
||||
function startApp() {
|
||||
// main application
|
||||
var myapp = new dwv.App();
|
||||
// initialise the application
|
||||
myapp.init({
|
||||
"containerDivId": "dwv",
|
||||
"fitToWindow": true,
|
||||
"gui": ["tool"],
|
||||
"tools": ["Scroll", "ZoomAndPan", "WindowLevel"],
|
||||
"isMobile": true
|
||||
});
|
||||
dwv.gui.appendResetHtml(myapp);
|
||||
}
|
||||
|
||||
// Image decoders (for web workers)
|
||||
dwv.image.decoderScripts = {
|
||||
"jpeg2000": "../../decoders/pdfjs/decode-jpeg2000.js",
|
||||
"jpeg-lossless": "../../decoders/rii-mango/decode-jpegloss.js",
|
||||
"jpeg-baseline": "../../decoders/pdfjs/decode-jpegbaseline.js"
|
||||
};
|
||||
|
||||
// status flags
|
||||
var domContentLoaded = false;
|
||||
var i18nInitialised = false;
|
||||
// launch when both DOM and i18n are ready
|
||||
function launchApp() {
|
||||
if ( domContentLoaded && i18nInitialised ) {
|
||||
startApp();
|
||||
}
|
||||
}
|
||||
// i18n ready?
|
||||
dwv.i18nOnInitialised( function () {
|
||||
i18nInitialised = true;
|
||||
launchApp();
|
||||
});
|
||||
|
||||
// check browser support
|
||||
dwv.browser.check();
|
||||
// initialise i18n
|
||||
dwv.i18nInitialise();
|
||||
|
||||
// DOM ready?
|
||||
document.addEventListener("DOMContentLoaded", function (/*event*/) {
|
||||
domContentLoaded = true;
|
||||
launchApp();
|
||||
});
|
||||
Reference in New Issue
Block a user