]> _ Git - fluidbook-html5.git/commitdiff
wip #2303 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Nov 2018 11:11:22 +0000 (12:11 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Nov 2018 11:11:22 +0000 (12:11 +0100)
js/libs/fluidbook/fluidbook.js

index a5b3fcfadee1a4b062b942006b97a26ee4d1ac6b..28ffaea3911601ef1a0cf68e77d9e7eff5e970e9 100644 (file)
@@ -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);