diff --git a/js/ready.js b/js/ready.js index 721c1df..d14fdfe 100644 --- a/js/ready.js +++ b/js/ready.js @@ -23,10 +23,9 @@ document.onreadystatechange = function () { options.session.preferences = $session.data('preferences') || {}; options.session.defaults = $session.data('defaults') || {}; options.session.basePath = $session.data('basepath'); + options.session.staticPath = $session.data('staticpath'); options.session.downloadLink = $session.data('downloadlink'); - console.log(options.session.basePath); - /* functions return jquery promises */ options.session.getPreference = function(name) { @@ -118,6 +117,7 @@ document.onreadystatechange = function () { EPUBJS.filePath = "vendor/epubjs/"; EPUBJS.cssPath = "vendor/epubjs/css/"; EPUBJS.basePath = $('.session').data('basepath'); + EPUBJS.staticPath = $('.session').data('staticpath'); /* device-specific boilerplate */ @@ -145,7 +145,7 @@ document.onreadystatechange = function () { function renderPdf(file, options) { PDFJS.filePath = "vendor/pdfjs/"; PDFJS.imageResourcesPath = "vendor/pdfjs/css/images/"; - PDFJS.workerSrc = options.session.basePath + 'vendor/pdfjs/lib/pdf.worker.js'; + PDFJS.workerSrc = options.session.staticPath + 'vendor/pdfjs/lib/pdf.worker.js'; var reader = pdfReader(file, options); } diff --git a/templates/cbreader.php b/templates/cbreader.php index c7aab33..51cc42f 100644 --- a/templates/cbreader.php +++ b/templates/cbreader.php @@ -28,7 +28,7 @@ ?> -
+' data-staticpath='linkTo('epubreader', ''));?>' data-scope='' data-cursor='' data-defaults='' data-preferences='' data-metadata='' data-annotations=''> diff --git a/templates/epubreader.php b/templates/epubreader.php index 6ddf590..d804403 100644 --- a/templates/epubreader.php +++ b/templates/epubreader.php @@ -28,7 +28,7 @@ ?> - +' data-staticpath='linkTo('epubreader', ''));?>' data-scope='' data-cursor='' data-defaults='' data-preferences='' data-metadata='' data-annotations=''> diff --git a/templates/pdfreader.php b/templates/pdfreader.php index fc77698..577de3c 100644 --- a/templates/pdfreader.php +++ b/templates/pdfreader.php @@ -28,7 +28,7 @@ ?> - +' data-staticpath='linkTo('epubreader', ''));?>' data-scope='' data-cursor='' data-defaults='' data-preferences='' data-metadata='' data-annotations=''> @@ -43,6 +43,7 @@ + diff --git a/vendor/cbrjs/cbr.js b/vendor/cbrjs/cbr.js index 082389a..e866d25 100644 --- a/vendor/cbrjs/cbr.js +++ b/vendor/cbrjs/cbr.js @@ -73,7 +73,7 @@ CBRJS.Reader = function(bookPath, _options) { xhr.onload = function () { if ((this.status === 200) && this.response) { var done = false; - var ua = new bitjs.archive[archive_class](this.response, document.head.dataset.basepath + 'vendor/bitjs/'); + var ua = new bitjs.archive[archive_class](this.response, document.head.dataset.staticpath + 'vendor/bitjs/'); ua.addEventListener(bitjs.archive.UnarchiveEvent.Type.START, function (e) { $progressbar.css('width', '0%'); @@ -276,7 +276,7 @@ ComicBook = (function ($) { 70: 'toggleFullscreen', // f 27: 'closeSidebar' // esc }, - vendorPath: document.head.dataset.basepath + 'vendor/', + vendorPath: document.head.dataset.staticpath + 'vendor/', forward_buffer: 3, session: { getCursor: function() {},