Files
2025-02-26 14:49:25 +07:00

52 lines
1.2 KiB
JavaScript

/**
* 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();
});