mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-02 14:49:17 +02:00
files_reader: #37, Palemoon (browser) does not hoist JS functions in block scope
This commit is contained in:
parent
3039417b6c
commit
dd9cc37ec8
1 changed files with 29 additions and 29 deletions
|
@ -97,43 +97,43 @@ document.onreadystatechange = function () {
|
||||||
default:
|
default:
|
||||||
console.log(type + ' is not supported by Reader');
|
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
|
// why is there no standard library function for this?
|
||||||
function renderEpub(file, options) {
|
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...
|
// start epub.js renderer
|
||||||
EPUBJS.filePath = "vendor/epubjs/";
|
function renderEpub(file, options) {
|
||||||
EPUBJS.cssPath = "vendor/epubjs/css/";
|
|
||||||
EPUBJS.basePath = $('.session').data('basepath');
|
|
||||||
|
|
||||||
/* device-specific boilerplate */
|
// some parameters...
|
||||||
|
EPUBJS.filePath = "vendor/epubjs/";
|
||||||
|
EPUBJS.cssPath = "vendor/epubjs/css/";
|
||||||
|
EPUBJS.basePath = $('.session').data('basepath');
|
||||||
|
|
||||||
|
/* device-specific boilerplate */
|
||||||
|
|
||||||
// IE < 11
|
// IE < 11
|
||||||
if (navigator.userAgent.indexOf("MSIE") != -1) {
|
if (navigator.userAgent.indexOf("MSIE") != -1) {
|
||||||
EPUBJS.Hooks.register("beforeChapterDisplay").wgxpath = function(callback, renderer){
|
EPUBJS.Hooks.register("beforeChapterDisplay").wgxpath = function(callback, renderer){
|
||||||
wgxpath.install(renderer.render.window);
|
wgxpath.install(renderer.render.window);
|
||||||
if(callback)
|
if(callback)
|
||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
wgxpath.install(window);
|
wgxpath.install(window);
|
||||||
}
|
|
||||||
|
|
||||||
var reader = ePubReader(file, options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// start cbr.js renderer
|
var reader = ePubReader(file, options);
|
||||||
function renderCbr(file, options) {
|
}
|
||||||
CBRJS.filePath = "vendor/cbrjs/";
|
|
||||||
|
|
||||||
var reader = cbReader(file, options);
|
// start cbr.js renderer
|
||||||
}
|
function renderCbr(file, options) {
|
||||||
|
CBRJS.filePath = "vendor/cbrjs/";
|
||||||
|
|
||||||
|
var reader = cbReader(file, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue