diff --git a/files_reader/js/ready.js b/files_reader/js/ready.js index 868315f..3396c1b 100644 --- a/files_reader/js/ready.js +++ b/files_reader/js/ready.js @@ -97,43 +97,43 @@ document.onreadystatechange = function () { default: console.log(type + ' is not supported by Reader'); } - - // why is there no standard library function for this? - function getUrlParameter (param) { - var pattern = new RegExp('[?&]'+param+'((=([^&]*))|(?=(&|$)))','i'); - var m = window.location.search.match(pattern); - return m && ( typeof(m[3])==='undefined' ? '' : m[3] ); - } + } - // start epub.js renderer - function renderEpub(file, options) { + // why is there no standard library function for this? + function getUrlParameter (param) { + var pattern = new RegExp('[?&]'+param+'((=([^&]*))|(?=(&|$)))','i'); + var m = window.location.search.match(pattern); + return m && ( typeof(m[3])==='undefined' ? '' : m[3] ); + } - // some parameters... - EPUBJS.filePath = "vendor/epubjs/"; - EPUBJS.cssPath = "vendor/epubjs/css/"; - EPUBJS.basePath = $('.session').data('basepath'); + // start epub.js renderer + function renderEpub(file, options) { - /* device-specific boilerplate */ + // some parameters... + EPUBJS.filePath = "vendor/epubjs/"; + EPUBJS.cssPath = "vendor/epubjs/css/"; + EPUBJS.basePath = $('.session').data('basepath'); + + /* device-specific boilerplate */ // IE < 11 - if (navigator.userAgent.indexOf("MSIE") != -1) { - EPUBJS.Hooks.register("beforeChapterDisplay").wgxpath = function(callback, renderer){ - wgxpath.install(renderer.render.window); - if(callback) - callback(); - }; - wgxpath.install(window); - } - - var reader = ePubReader(file, options); + if (navigator.userAgent.indexOf("MSIE") != -1) { + EPUBJS.Hooks.register("beforeChapterDisplay").wgxpath = function(callback, renderer){ + wgxpath.install(renderer.render.window); + if(callback) + callback(); + }; + wgxpath.install(window); } - // start cbr.js renderer - function renderCbr(file, options) { - CBRJS.filePath = "vendor/cbrjs/"; + var reader = ePubReader(file, options); + } - var reader = cbReader(file, options); - } + // start cbr.js renderer + function renderCbr(file, options) { + CBRJS.filePath = "vendor/cbrjs/"; + + var reader = cbReader(file, options); } };