I am implementing an offline solution, similar to the offline library sample and am running into problems getting configurations to load when offline. I use series of custom configs, and I set the config option when i instantiate the viewer. All of it works fine when online. I include the config files in the offline manifest, but the custom config are loaded dynamically with ajax and it will not load the custom config, even though the files are there. To get it to work, I found that I had to steal some code from ControlUtils.initializeReaderControl to force the ajax call to load the config files from the application cache:
function loadConfigScript() {
if (configScript !== null && configScript.length > 0) {
if (queryParams.getBoolean('startOffline')) {
$.ajaxSetup({
cache: true
});
}
.....
I'm not sure if there is a better way to do this, or if this is an appropriate fix. Any feedback would be appreciated.
Thanks,
David Collins