var pdf;
var pdfName;
- console.log('open PDF : ' + this.datas.pages + " || " + this.contentlock.getMaxPage());
-
if (this.datas.pages != this.contentlock.getMaxPage()) {
pdf = 'https://workshop.fluidbook.com/s/e/' + this.datas.cid + '/1-' + this.contentlock.getMaxPage();
- } else if (this.datas.pdfName.substr(0, 4) == 'http') {
+ } else if (this.datas.pdfName.substr(0, 4) === 'http') {
pdf = this.datas.pdfName;
} else {
pdf = this.relativeToAbsolute('data/' + this.datas.pdfName);
type = e.pop();
}
- if (url.indexOf('http') == 0) {
+ if (url.indexOf('http') === 0) {
return this._downloadFilePhonegap(url, localname, window.TEMPORARY, this._openFilePhonegap, [url, e, type]);
} else {
if (this._openFilePhonegap(url, e, type)) {
if (this.datas.phonegap === 'ios') {
console.log('open download on ios ' + type + ' -> ' + types_ios[type]);
this.displayLoader();
- if (types_ios[type] != undefined) {
+ if (types_ios[type] !== undefined) {
console.log('intro to open with External file util');
try {
target = '_self';
}
var href = $(this).attr('href');
- var external = href.substr(0, 4) == 'http';
- if (href == '#') {
+ var external = href.substr(0, 4) === 'http';
+ if (href === '#') {
return true;
}
return false;
}
- if ($(this).data('type') == 16 && external) {
+ if ($(this).data('type') === 16 && external) {
target = '_system';
}
- if (target == '_self') {
+ if ($this.fluidbook.datas.phonegap === 'android' && $(this).data('type') === 16 && !external) {
+ var url = $(this).attr('href')
+ $this.fluidbook._openFile($this.fluidbook.relativeToAbsolute(url), $("body"), 'pdf');
+ return;
+ }
+
+ if (target === '_self') {
return true;
}
fluidbook.wopen($(this).attr('href'), target);
} else if (icon == 'pdf' && this.fluidbook.datas.pdf) {
link = this.addLink(navType, 'nav-download', '#', 'download', 'download', 'download');
} else if (icon == 'print' && this.fluidbook.datas.print) {
- link = this.addLink(navType, 'nav-print', '#/print', 'print', 'print', 'print');
+ link = this.addLink(navType, 'nav-print', '#', 'print', 'print', 'print');
} else if (icon == 'basket' && this.fluidbook.cart != undefined && this.fluidbook.cart.enabled) {
link = this.addLink(navType, 'nav-basket', '#/cart', 'cart', 'basket', 'basket');
$(this.fluidbook).on('fluidbook.cart.updateIcon', {link: $(link).attr('id')}, function (e, data) {
event.preventDefault();
// Should we show complex PDF download options? Or just give them the full PDF?
- if ($this.fluidbook.datas.pdfComplex) {
+ if ($this.fluidbook.datas.pdfComplex && this.datas.phonegap === false) {
$this.fluidbook.menu.openView('download');
} else {
$this.fluidbook.downloadPDF($(this));
});
// Print icon
- // $(document).on('click', '.icon-print', function () {
- // $this.fluidbook.print($(this));
- // return false;
- // });
+ $(document).on('click', '.icon-print', function () {
+ if ($this.fluidbook.datas.phonegap !== false) {
+ $this.fluidbook.print($(this));
+ return false;
+ } else {
+ $this.fluidbook.menu.openView('print');
+ }
+ return false;
+ });
// Bookmarks icon
$(document).on('click', '.icon-bookmarks', function () {