]> _ Git - fluidbook-html5.git/commitdiff
done #1512 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Jun 2017 16:16:34 +0000 (18:16 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 29 Jun 2017 16:16:34 +0000 (18:16 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.support.js

index 86c0ed096b8776311cd7347208c8d7c3121ff890..3b199518e3d2307de208264b1d522dd27a585934 100644 (file)
@@ -60,8 +60,7 @@ Fluidbook.prototype = {
         this.searchHintXHR = null;
         this.searchString = '';
         this.termsToHighlight = '';
-        this.imagesVersion = (this.datas.mobileVersion == 'html5-images' || !this.support.SVG);
-        this.vectorTexts = !this.imagesVersion;
+        this.vectorTexts = !this.support.imagesVersion;
         this.displayOnePage = false;
         this.indexHTML = '';
         this.transitionning = false;
@@ -668,7 +667,7 @@ Fluidbook.prototype = {
             this.audiodescription.setupPages();
         }
 
-        $(this).trigger('fluidbook.page.change.end',[this.currentPage]);
+        $(this).trigger('fluidbook.page.change.end', [this.currentPage]);
     },
     setPageNumbers: function () {
         $("#pagesnumbers .left").html(this.getPageNumberOfSide('left'));
index 947c59620ac3a07ac2d990d85c5bdb781e832b73..2fb86c903d41a086c2dec3bf4285392904ff50f8 100644 (file)
@@ -11,7 +11,7 @@ function FluidbookLoader(fluidbook) {
 FluidbookLoader.prototype = {
     canPreload: function () {
         this.numPreload = 6;
-        if (this.fluidbook.imagesVersion) {
+        if (this.fluidbook.support.imagesVersion) {
             this.numPreload += 6;
         }
         if (this.fluidbook.datas.phonegap) {
@@ -187,7 +187,7 @@ FluidbookLoader.prototype = {
     },
     getBackgroundURL: function (page) {
         var prefix = 'p';
-        if (this.fluidbook.imagesVersion) {
+        if (this.fluidbook.support.imagesVersion) {
             prefix = 't';
         }
 
@@ -224,7 +224,7 @@ FluidbookLoader.prototype = {
     },
     loadTexts: function (pageNr, callback) {
 
-        if (this.fluidbook.imagesVersion) {
+        if (this.fluidbook.support.imagesVersion) {
             callback();
             return;
         }
index 26576260465d2d4addd355c4a8ad90f323f0451b..2e991ebcac665d35088b9bd917010628f41299bd 100644 (file)
@@ -5,6 +5,21 @@ function FluidbookSupport(fluidbook) {
     this.android3 = this.android && this.userAgent.search(/android 3/i) > -1;
     this.iOS = this.userAgent.search(/ipad/i) > -1 || this.userAgent.search(/iphone/i) > -1 || this.userAgent.search(/ipod/i) > -1;
 
+    switch (this.fluidbook.datas.mobileVersion) {
+        case 'html5':
+            this.imagesVersion = false;
+            break;
+        case 'html5-images':
+            this.imagesVersion = true;
+            break;
+        case 'html5-desktop':
+            this.imagesVersion = this.iOS || this.android;
+            break;
+        default:
+            this.imagesVersion = false;
+            break;
+    }
+
     this.transitions2d = Modernizr.csstransforms && Modernizr.csstransitions;
     this.transitions3d = Modernizr.csstransforms3d && Modernizr.preserve3d && this.transitions2d;