From cbf2fa7d5d476281faa9ac62ab14ce3489fadd59 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 29 Nov 2018 12:11:22 +0100 Subject: [PATCH] wip #2303 @0.25 --- js/libs/fluidbook/fluidbook.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index a5b3fcfa..28ffaea3 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -87,8 +87,7 @@ Fluidbook.prototype = { this.transitionAxis = 'x'; if (this.support.isMobile) { $("body").addClass('mobile'); - } - else { + } else { $("body").addClass('desktop'); } if (this.pad.enabled) { @@ -164,7 +163,7 @@ Fluidbook.prototype = { } $(this).trigger('fluidbook.splash.beforehide'); var $this = this; - if (this.support.transitions3dacc && this.datas.mobileTransitions==='flip3d') { + if (this.support.transitions3dacc && this.datas.mobileTransitions === 'flip3d') { this.pauseNetwork(1500); setTimeout(function () { this.fluidbook.pagetransitions.flip3d.performancesTest(function () { @@ -400,16 +399,12 @@ Fluidbook.prototype = { $this.hideSplash(); }, true); - } - - else if (args[1] == 'landing') { + } else if (args[1] == 'landing') { $this.hideSplash(); if (this.landingpage !== undefined) { this.landingpage.show(); } - } - - else { + } else { var view = args[1]; if (this.currentPage == -1) { if (view == 'multimedia' || view == 'video') { @@ -667,7 +662,7 @@ Fluidbook.prototype = { _downloadFilePhonegap: function (url, localname, fs, callback, callbackArgs) { console.log('download file phonegap'); var $this = this; - if (fs == undefined) { + if (fs === undefined) { fs = LocalFileSystem.PERSISTENT; } @@ -686,8 +681,8 @@ Fluidbook.prototype = { filePath, function (entry) { console.log('file donwloaded'); - if (callback != undefined) { - if (callbackArgs == undefined) { + if (callback !== undefined) { + if (callbackArgs === undefined) { callbackArgs = []; } callbackArgs[0] = entry.toURL(); @@ -708,7 +703,7 @@ Fluidbook.prototype = { var $this = this; var types_ios = {pdf: 'com.adobe.pdf'}; var types_android = {pdf: 'application/pdf'}; - if (this.datas.phonegap == 'ios') { + if (this.datas.phonegap === 'ios') { console.log('open download on ios ' + type + ' -> ' + types_ios[type]); this.displayLoader(); if (types_ios[type] != undefined) { @@ -750,8 +745,8 @@ Fluidbook.prototype = { } } - if (this.datas.phonegap == 'android') { - if (types_android[type] != undefined) { + if (this.datas.phonegap === 'android') { + if (types_android[type] !== undefined) { console.log('open pdf file'); this.displayLoader(); window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function (fileSystem) { @@ -770,6 +765,7 @@ Fluidbook.prototype = { }, function (args) { $this.hideLoader(5); }, function (args) { + this.wopen(copyEntry.toURL(), '_blank', ''); $this.hideLoader(5); }); }, lazy); -- 2.39.5