]> _ Git - fluidbook-html5.git/commitdiff
wip #3386 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 31 Jan 2020 14:44:21 +0000 (15:44 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 31 Jan 2020 14:44:21 +0000 (15:44 +0100)
43 files changed:
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/fluidbook/fluidbook.audiodescription.js
js/libs/fluidbook/fluidbook.background.js
js/libs/fluidbook/fluidbook.bookmarks.js
js/libs/fluidbook/fluidbook.cart.js
js/libs/fluidbook/fluidbook.contentlock.js
js/libs/fluidbook/fluidbook.desktop.js
js/libs/fluidbook/fluidbook.help.js
js/libs/fluidbook/fluidbook.interface.js
js/libs/fluidbook/fluidbook.l10n.js
js/libs/fluidbook/fluidbook.landingpage.js
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.menu.js
js/libs/fluidbook/fluidbook.mobilefirst.js
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/fluidbook.pad.js
js/libs/fluidbook/fluidbook.pagetransitions.js
js/libs/fluidbook/fluidbook.print.js
js/libs/fluidbook/fluidbook.privacy.js
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.scorm.js
js/libs/fluidbook/fluidbook.search.js
js/libs/fluidbook/fluidbook.service.js
js/libs/fluidbook/fluidbook.share.js
js/libs/fluidbook/fluidbook.sound.js
js/libs/fluidbook/fluidbook.stats.js
js/libs/fluidbook/fluidbook.support.js
js/libs/fluidbook/fluidbook.tabs.js
js/libs/fluidbook/fluidbook.touch.js
js/libs/fluidbook/fluidbook.video.js
js/libs/fluidbook/fluidbook.zoom.js
js/libs/fluidbook/forms/fluidbook.form.avery.js
js/libs/fluidbook/forms/fluidbook.form.bulle.js
js/libs/fluidbook/links/fluidbook.links.zoom.js
js/libs/fluidbook/menu/fluidbook.chapters.js
js/libs/fluidbook/menu/fluidbook.index.js
js/libs/fluidbook/mobilefirst/fluidbook.mobilefirst.slider.js
js/libs/fluidbook/special/atlanticdownload.js
js/libs/fluidbook/special/wescosales.js
js/libs/scorm/scorm.js
js/main.js
js/widget.js

index d3585d82c63bc44798c7c8198f7dbbae48fcbfb6..abb1024568c68f687c088b96f4cccb6645ac7300 100644 (file)
@@ -66,8 +66,8 @@ Fluidbook3DFlip.prototype = {
             var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
             var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
 
-            if (this.fluidbook.datas.gupsc[renderer] !== undefined && this.fluidbook.datas.gupsc[renderer] !== null) {
-                this.benchmark = this.fluidbook.datas.gupsc[renderer];
+            if (this.fluidbook.settings.gupsc[renderer] !== undefined && this.fluidbook.settings.gupsc[renderer] !== null) {
+                this.benchmark = this.fluidbook.settings.gupsc[renderer];
                 cb();
             } else {
                 $.ajax({
@@ -226,7 +226,7 @@ Fluidbook3DFlip.prototype = {
         this.enableLight = !this.lowPerf && this.renderEngine === 'webgl';
         this.enableShadow = !this.lowPerf && this.enableLight && this.renderEngine === 'webgl';
         this.antialias = false;
-        this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration);
+        this.animationTime = parseFloat(this.fluidbook.settings.mobileTransitionDuration);
 
         if (this.veryLowPerf) {
             this.qualityRatio = .8;
@@ -286,7 +286,7 @@ Fluidbook3DFlip.prototype = {
         }
         var geometry;
         if (this.enableShadow) {
-            geometry = new THREE.PlaneGeometry(this.fluidbook.datas.width * this.geometryScale * 2, this.fluidbook.datas.height * this.geometryScale, 1, 1, true);
+            geometry = new THREE.PlaneGeometry(this.fluidbook.settings.width * this.geometryScale * 2, this.fluidbook.settings.height * this.geometryScale, 1, 1, true);
             var shadowTexture = new THREE.ShadowMaterial({
                 color: 0x000000,
                 side: THREE.FrontSide,
@@ -299,8 +299,8 @@ Fluidbook3DFlip.prototype = {
             this.scene.add(this.shadowPlane);
         }
 
-        this.geometryWidth = this.fluidbook.datas.width * this.geometryScale;
-        this.geometryHeight = this.fluidbook.datas.height * this.geometryScale;
+        this.geometryWidth = this.fluidbook.settings.width * this.geometryScale;
+        this.geometryHeight = this.fluidbook.settings.height * this.geometryScale;
 
         geometry = new THREE.PlaneGeometry(this.geometryWidth, this.geometryHeight, Math.round(this.triangles * 5), Math.round(this.triangles), true);
         var geometry2 = geometry.clone();
@@ -326,7 +326,7 @@ Fluidbook3DFlip.prototype = {
             ];
         }
 
-        geometry.translate(this.fluidbook.datas.width * this.geometryScale * 0.5, 0, 0);
+        geometry.translate(this.fluidbook.settings.width * this.geometryScale * 0.5, 0, 0);
 
         this.plane = new THREE.Mesh(geometry, this.textures);
         this.plane.castShadow = this.enableShadow;
@@ -345,7 +345,7 @@ Fluidbook3DFlip.prototype = {
         this.bendOffset = 0.65;
         this.bendForceMultiplicator = 1;
 
-        var ratio = this.fluidbook.datas.width / this.fluidbook.datas.height;
+        var ratio = this.fluidbook.settings.width / this.fluidbook.settings.height;
 
         if (ratio > 1.2) {
             this.bendAngle = 15;
index 669983c44548447071011c424e457a6801628558..e6d4d13f9d9e6993730ff397023719b8702949ec 100644 (file)
@@ -134,13 +134,13 @@ FluidbookAudioDescription.prototype = {
             return false;
         }
 
-        if (this.fluidbook.datas.audiodescription === undefined) return false;
+        if (this.fluidbook.settings.audiodescription === undefined) return false;
 
-        return (this.fluidbook.datas.audiodescription[page] !== undefined);
+        return (this.fluidbook.settings.audiodescription[page] !== undefined);
     },
 
     getAudio: function (page) {
-        return this.dataPath + this.fluidbook.datas.audiodescription[page];
+        return this.dataPath + this.fluidbook.settings.audiodescription[page];
     },
 
     playSide: function (side) {
index d51079986d467209fed3d8ad7c96444a6c73bd91..aa1cab5168847ae047f1cc75ede9ec38483af0a4 100644 (file)
@@ -6,12 +6,12 @@ function FluidbookBackground(fluidbook) {
 
 FluidbookBackground.prototype = {
     init: function () {
-        if (this.fluidbook.datas.links.background !== undefined
-            && (this.fluidbook.datas.repeat !== Fluidbook.REPEAT || this.fluidbook.tabs.hasTabs())
-            && this.fluidbook.datas.links.background !== ''
-            && this.fluidbook.datas.mobileIgnoreBackgroundLinks === false) {
+        if (this.fluidbook.settings.links.background !== undefined
+            && (this.fluidbook.settings.repeat !== Fluidbook.REPEAT || this.fluidbook.tabs.hasTabs())
+            && this.fluidbook.settings.links.background !== ''
+            && this.fluidbook.settings.mobileIgnoreBackgroundLinks === false) {
 
-            $("#background").prepend('<div class="links">' + this.fluidbook.datas.links.background + '</div>');
+            $("#background").prepend('<div class="links">' + this.fluidbook.settings.links.background + '</div>');
             this.hasLinks = true;
         }
     },
@@ -27,26 +27,26 @@ FluidbookBackground.prototype = {
 
         var left, top, iw, ih;
 
-        if (this.fluidbook.datas.backgroundImageDimensions === undefined) {
+        if (this.fluidbook.settings.backgroundImageDimensions === undefined) {
 
-        } else if (this.fluidbook.datas.repeat === Fluidbook.NONE) {
-            iw = this.fluidbook.datas.backgroundImageDimensions.width;
-            ih = this.fluidbook.datas.backgroundImageDimensions.height;
+        } else if (this.fluidbook.settings.repeat === Fluidbook.NONE) {
+            iw = this.fluidbook.settings.backgroundImageDimensions.width;
+            ih = this.fluidbook.settings.backgroundImageDimensions.height;
 
-            if (this.fluidbook.datas.backgroundHAlign === Fluidbook.LEFT) {
+            if (this.fluidbook.settings.backgroundHAlign === Fluidbook.LEFT) {
                 left = 0
-            } else if (this.fluidbook.datas.backgroundHAlign === Fluidbook.RIGHT) {
+            } else if (this.fluidbook.settings.backgroundHAlign === Fluidbook.RIGHT) {
                 left = w - iw;
-            } else if (this.fluidbook.datas.backgroundHAlign === Fluidbook.CENTER) {
+            } else if (this.fluidbook.settings.backgroundHAlign === Fluidbook.CENTER) {
                 left = (w - iw) / 2;
             }
 
 
-            if (this.fluidbook.datas.backgroundVAlign === Fluidbook.TOP) {
+            if (this.fluidbook.settings.backgroundVAlign === Fluidbook.TOP) {
                 top = 0
-            } else if (this.fluidbook.datas.backgroundVAlign === Fluidbook.BOTTOM) {
+            } else if (this.fluidbook.settings.backgroundVAlign === Fluidbook.BOTTOM) {
                 top = h - ih;
-            } else if (this.fluidbook.datas.backgroundVAlign === Fluidbook.MIDDLE) {
+            } else if (this.fluidbook.settings.backgroundVAlign === Fluidbook.MIDDLE) {
                 top = (h - ih) / 2;
             }
 
@@ -54,41 +54,41 @@ FluidbookBackground.prototype = {
                 top: top,
                 left: left
             });
-        } else if (this.fluidbook.datas.repeat === Fluidbook.RATIO || this.fluidbook.datas.repeat === Fluidbook.STRETCH) {
+        } else if (this.fluidbook.settings.repeat === Fluidbook.RATIO || this.fluidbook.settings.repeat === Fluidbook.STRETCH) {
 
             var origin = ['0%', '0%', '0%'];
-            // if (this.fluidbook.datas.backgroundHAlign == Fluidbook.LEFT) {
+            // if (this.fluidbook.settings.backgroundHAlign == Fluidbook.LEFT) {
             //     origin[0] = '0%';
-            // } else if (this.fluidbook.datas.backgroundHAlign == Fluidbook.RIGHT) {
+            // } else if (this.fluidbook.settings.backgroundHAlign == Fluidbook.RIGHT) {
             //     origin[0] = '100%';
-            // } else if (this.fluidbook.datas.backgroundHAlign == Fluidbook.CENTER) {
+            // } else if (this.fluidbook.settings.backgroundHAlign == Fluidbook.CENTER) {
             //     origin[0] = '50%';
             // }
-            // if (this.fluidbook.datas.backgroundVAlign == Fluidbook.TOP) {
+            // if (this.fluidbook.settings.backgroundVAlign == Fluidbook.TOP) {
             //     origin[1] = '0%';
-            // } else if (this.fluidbook.datas.backgroundVAlign == Fluidbook.BOTTOM) {
+            // } else if (this.fluidbook.settings.backgroundVAlign == Fluidbook.BOTTOM) {
             //     origin[1] = '100%';
-            // } else if (this.fluidbook.datas.backgroundVAlign == Fluidbook.MIDDLE) {
+            // } else if (this.fluidbook.settings.backgroundVAlign == Fluidbook.MIDDLE) {
             //     origin[1] = '50%';
             // }
             //
             // Todo, search why this works :)
             origin = ['0%', '0%', '0%'];
 
-            var bw = parseFloat(this.fluidbook.datas.backgroundImageDimensions.width);
-            var bh = parseFloat(this.fluidbook.datas.backgroundImageDimensions.height);
+            var bw = parseFloat(this.fluidbook.settings.backgroundImageDimensions.width);
+            var bh = parseFloat(this.fluidbook.settings.backgroundImageDimensions.height);
 
             var translateX = 0;
             var translateY = 0;
             var css = {};
             var scaleX = w / bw;
             var scaleY = h / bh;
-            if (this.fluidbook.datas.repeat === Fluidbook.RATIO) {
+            if (this.fluidbook.settings.repeat === Fluidbook.RATIO) {
                 if (scaleX < scaleY) {
                     var l = ((scaleX - scaleY) * bw);
-                    if (this.fluidbook.datas.backgroundHAlign === Fluidbook.CENTER) {
+                    if (this.fluidbook.settings.backgroundHAlign === Fluidbook.CENTER) {
                         css.left = l / 2;
-                    } else if (this.fluidbook.datas.backgroundHAlign === Fluidbook.LEFT) {
+                    } else if (this.fluidbook.settings.backgroundHAlign === Fluidbook.LEFT) {
                         css.left = 0;
                     }
                 } else {
index 92a3324fe60602f2ca9abf690696ec3030f485fb..def03894464c3ee01cdfe50fc13d8a25d4fefe86 100644 (file)
@@ -17,7 +17,7 @@ function FluidbookBookmarks(fluidbook) {
     this._cornersIndex = [];
     this._cornersPages = [];
 
-    this.enabled = this.fluidbook.datas.bookmark;
+    this.enabled = this.fluidbook.settings.bookmark;
     this.init();
 }
 
@@ -32,18 +32,18 @@ FluidbookBookmarks.prototype = {
 
         $(document).on('click', '.bookmarkssub a.send', function () {
             var subject = '%title%';
-            if ($this.fluidbook.datas.bookmark_email_title !== '') {
-                subject = $this.fluidbook.datas.bookmark_email_title;
+            if ($this.fluidbook.settings.bookmark_email_title !== '') {
+                subject = $this.fluidbook.settings.bookmark_email_title;
             }
 
 
             var body = $this.fluidbook.l10n.__('Please see the attached files from "%title%".');
-            if ($this.fluidbook.datas.bookmark_email_body !== '') {
-                body = $this.fluidbook.datas.bookmark_email_body;
+            if ($this.fluidbook.settings.bookmark_email_body !== '') {
+                body = $this.fluidbook.settings.bookmark_email_body;
             }
 
-            subject = subject.replace(/\%title\%/gi, $this.fluidbook.datas.title);
-            body = trim(body.replace(/\%title\%/gi, $this.fluidbook.datas.title), ' .:');
+            subject = subject.replace(/\%title\%/gi, $this.fluidbook.settings.title);
+            body = trim(body.replace(/\%title\%/gi, $this.fluidbook.settings.title), ' .:');
             body += $this.fluidbook.l10n.__(": ") + $this.getPDF();
 
             $this.fluidbook.share.intentShare(subject, body);
@@ -52,7 +52,7 @@ FluidbookBookmarks.prototype = {
 
         $(document).on('click', '.bookmarkssub a.download', function () {
             $(this).data('ios-preview', '1');
-            if (!navigator.onLine && $this.fluidbook.datas.phonegap) {
+            if (!navigator.onLine && $this.fluidbook.settings.phonegap) {
                 $this.fluidbook.alertInternetRequired();
                 return false;
             }
@@ -60,9 +60,9 @@ FluidbookBookmarks.prototype = {
             return false;
         });
 
-        for (var g in this.fluidbook.datas.bookmarkGroups) {
+        for (var g in this.fluidbook.settings.bookmarkGroups) {
 
-            var group = this.fluidbook.datas.bookmarkGroups[g];
+            var group = this.fluidbook.settings.bookmarkGroups[g];
             this.addGroup(group.page, group.nb, group.name);
         }
         this.completeGroups();
@@ -86,7 +86,7 @@ FluidbookBookmarks.prototype = {
         this.fluidbook._openFile(this.getPDF(), element, 'pdf', this.getBookmarksCompacted() + '.pdf', print);
     },
     getPDF: function () {
-        return 'https://workshop.fluidbook.com/s/e/' + this.fluidbook.datas.cid + '/' + this.getBookmarksCompacted();
+        return 'https://workshop.fluidbook.com/s/e/' + this.fluidbook.settings.cid + '/' + this.getBookmarksCompacted();
     },
     getBookmarksCompacted: function () {
         this.bookmarks.sort(this.sortnumeric);
@@ -128,7 +128,7 @@ FluidbookBookmarks.prototype = {
         return g.join(',');
     },
     addGroup: function (from, nb, name) {
-        var to = Math.min(from + (nb - 1), this.fluidbook.datas.pages);
+        var to = Math.min(from + (nb - 1), this.fluidbook.settings.pages);
         for (var i = from; i <= to; i++) {
             this._pagesToGroup[i] = this._groups;
         }
@@ -137,7 +137,7 @@ FluidbookBookmarks.prototype = {
         this._groups++;
     },
     completeGroups: function () {
-        for (var i = 1; i <= this.fluidbook.datas.pages; i++) {
+        for (var i = 1; i <= this.fluidbook.settings.pages; i++) {
             if (this._pagesToGroup[i] === undefined || this._pagesToGroup[i] === null) {
                 this._pagesToGroup[i] = this._groups;
                 this._groupOrder.push(this._groups);
@@ -181,7 +181,7 @@ FluidbookBookmarks.prototype = {
     },
     getPagesOfGroup: function (groupId) {
         var res = [];
-        for (var i = 1; i <= this.fluidbook.datas.pages; i++) {
+        for (var i = 1; i <= this.fluidbook.settings.pages; i++) {
             if (this._pagesToGroup[i] === groupId) {
                 res.push(i);
             }
@@ -355,7 +355,7 @@ FluidbookBookmarks.prototype = {
         return this.areBookmarksAllowedOn(page) && this.bookmarks.indexOf(page) > -1;
     },
     areBookmarksAllowedOn: function (pageNr) {
-        return this.fluidbook.datas.bookmarkDisablePages.indexOf(pageNr) === -1;
+        return this.fluidbook.settings.bookmarkDisablePages.indexOf(pageNr) === -1;
     },
     getBookmarkForPage: function (pageNr, allwaysAtRight, permanentIcon) {
         if (!this.areBookmarksAllowedOn(pageNr)) {
@@ -498,11 +498,11 @@ FluidbookBookmarks.prototype = {
         }
         index += '</div></div>';
         index += '<div class="fonctions">';
-        if (this.fluidbook.datas.friend && this.fluidbook.datas.bookmarkSendEnable) {
+        if (this.fluidbook.settings.friend && this.fluidbook.settings.bookmarkSendEnable) {
             index += '<a class="send" href="#">' + this.fluidbook.l10n.__('send') + '</a>';
 
         }
-        if (this.fluidbook.datas.print || this.fluidbook.datas.pdf) {
+        if (this.fluidbook.settings.print || this.fluidbook.settings.pdf) {
             // ToDo: differentiate between download & print?
             index += '<a class="download" href="#">' + downloadLabel + '</a>';
         }
index e8d7b4f2eed9266c6c833588942418740fd4c9e8..6c1036bfa8aa90804a46df786ead9f13edebc107 100644 (file)
@@ -7,7 +7,7 @@ function FluidbookCart(fluidbook) {
 
 FluidbookCart.prototype = {
     init: function () {
-        if (!this.fluidbook.datas.basket) {
+        if (!this.fluidbook.settings.basket) {
             return false;
         }
         var $this = this;
@@ -39,7 +39,7 @@ FluidbookCart.prototype = {
         this.fluidbook.cache.set('cart', data);
     },
     createInstance: function () {
-        switch (this.fluidbook.datas.basketManager) {
+        switch (this.fluidbook.settings.basketManager) {
             case "Remarkable":
                 return new FluidbookCartRemarkable(this);
             default:
index e1f75a9dfa24a613353ed36e0e9dba1daa05d94b..a0ffee831329a766001f844efa12580c47f516ae 100644 (file)
@@ -2,7 +2,7 @@ function FluidbookContentLock(fluidbook) {
     this.fluidbook = fluidbook;
     this.maxPage;
     this.linksActions = {};
-    this.locks = this.fluidbook.datas.content_lock;
+    this.locks = this.fluidbook.settings.content_lock;
 }
 
 FluidbookContentLock.prototype = {
@@ -15,7 +15,7 @@ FluidbookContentLock.prototype = {
 
         this.maxPage = this.getNextLockPage();
         if (this.maxPage <= 0) {
-            this.maxPage = this.fluidbook.datas.pages;
+            this.maxPage = this.fluidbook.settings.pages;
         }
     },
 
@@ -38,14 +38,14 @@ FluidbookContentLock.prototype = {
             allowbackwards = false;
         }
         if (p === undefined || p <= 0) {
-            p = this.fluidbook.datas.pages;
+            p = this.fluidbook.settings.pages;
         }
 
         if (!allowbackwards && p < this.maxPage) {
             return;
         }
 
-        this.maxPage = Math.min(p, this.fluidbook.datas.pages);
+        this.maxPage = Math.min(p, this.fluidbook.settings.pages);
         if (currentMaxPage === this.maxPage) {
             return;
         }
index d8798bc543490fc8ef6168c102cffa52a636e75f..d6e51c2ab68247981f3e1a0f15f06a4325aa9ad0 100644 (file)
@@ -57,7 +57,7 @@ FluidbookDesktop.prototype = {
         }
         var newScale;
         if (way == 1) {
-            newScale = this.fluidbook.datas.zoom / 100;
+            newScale = this.fluidbook.settings.zoom / 100;
         } else if (way == -1) {
             newScale = 1;
         }
index 059ec8735951510fa79b650acda596fcdf29371b..0ad58b6bfc62084181fed389c25b2a55b1260baa 100644 (file)
@@ -87,7 +87,7 @@ FluidbookHelp.prototype = {
 
         // When the menu position is inverted, the icon help lines need
         // to be drawn in the reverse order to avoid text/line overlaps
-        var tooltips = this.fluidbook.datas.invertMenuPosition ? $(tooltipSelector).get().reverse() : $(tooltipSelector);
+        var tooltips = this.fluidbook.settings.invertMenuPosition ? $(tooltipSelector).get().reverse() : $(tooltipSelector);
         var navScale = this.fluidbook.resize.navScale;
         var initialHeight = 20 * navScale; // Buffer in line height away from icons
         var hStep = 25 * navScale; // The step height - the difference in height between the icon label lines
@@ -272,7 +272,7 @@ FluidbookHelp.prototype = {
 
         var $this = this;
         var dir = this.fluidbook.l10n.dir;
-        var menuHeightScaled = (this.fluidbook.datas.menuHeight) * navScale;
+        var menuHeightScaled = (this.fluidbook.settings.menuHeight) * navScale;
         var nextTop;
         var firstTop;
 
@@ -301,7 +301,7 @@ FluidbookHelp.prototype = {
         }
 
         if (this.fluidbook.bookmarks.enabled) {
-            var inverted = this.fluidbook.datas.invertMenuPosition;
+            var inverted = this.fluidbook.settings.invertMenuPosition;
             var side = ((this.fluidbook.l10n.dir === 'ltr' && inverted) || (this.fluidbook.l10n.dir === 'rtl' && !inverted)) ? 'left' : 'right';
             if (this.fluidbook.mobilefirst.enabled) {
                 side = 'right';
@@ -386,9 +386,9 @@ FluidbookHelp.prototype = {
     },
 
     displayAtStartup: function () {
-        if (this.fluidbook.datas.helpStartup) {
+        if (this.fluidbook.settings.helpStartup) {
             var $this = this;
-            var time = parseInt(this.fluidbook.datas.helpStartupTime);
+            var time = parseInt(this.fluidbook.settings.helpStartupTime);
             this.ignoreResize = true;
             setTimeout(function () {
                 $this.ignoreResize = false;
@@ -398,8 +398,8 @@ FluidbookHelp.prototype = {
                 this.fluidbook.pad.displayInterface();
             }
         } else {
-            if (this.fluidbook.datas.landscapeWarning !== '' && (this.fluidbook.support.iOS || this.fluidbook.support.android)) {
-                this.fluidbook.menu.openView('text', this.fluidbook.datas.landscapeWarning, function () {
+            if (this.fluidbook.settings.landscapeWarning !== '' && (this.fluidbook.support.iOS || this.fluidbook.support.android)) {
+                this.fluidbook.menu.openView('text', this.fluidbook.settings.landscapeWarning, function () {
 
                 });
             }
@@ -419,7 +419,7 @@ FluidbookHelp.prototype = {
         // be possible to always display the bookmark icon in this case...
 
         var dir = this.fluidbook.l10n.dir;
-        var inverted = this.fluidbook.datas.invertMenuPosition;
+        var inverted = this.fluidbook.settings.invertMenuPosition;
         var side = ((dir === 'ltr' && inverted) || (dir === 'rtl' && !inverted)) ? 'left' : 'right';
         if (this.fluidbook.mobilefirst.enabled) {
             side = 'right';
index 5a1a319d9d7885b9989bee243eb8f62c6c50cce4..e07128aaf56c35a515a2e332126e693e11e71102 100644 (file)
@@ -38,7 +38,7 @@ FluidbookInterface.prototype = {
     },
 
     arrowsEnabled: function () {
-        switch (this.fluidbook.datas.arrowsEnabled) {
+        switch (this.fluidbook.settings.arrowsEnabled) {
             case '0':
                 return false;
             case '1':
index 9a70d071b7232270a59ed156643ec4c801c208b7..e29a49e9a2e7f527609766b60e44d9364fa6a210 100644 (file)
@@ -16,7 +16,7 @@ FluidbookL10N.prototype = {
         }
         this.lang = lang;
         if (this.lang === "default") {
-            this.currentLang = this.fluidbook.datas.defaultLang;
+            this.currentLang = this.fluidbook.settings.defaultLang;
         } else {
             this.currentLang = this.lang;
         }
@@ -34,10 +34,10 @@ FluidbookL10N.prototype = {
         }
 
         if (this.lang === 'default') {
-            this.translations = this.fluidbook.datas.l10n[this.fluidbook.datas.defaultLang];
-            $.extend(this.translations, this.fluidbook.datas.l10n[this.lang]);
+            this.translations = this.fluidbook.settings.l10n[this.fluidbook.settings.defaultLang];
+            $.extend(this.translations, this.fluidbook.settings.l10n[this.lang]);
         } else {
-            this.translations = this.fluidbook.datas.l10n[this.lang];
+            this.translations = this.fluidbook.settings.l10n[this.lang];
         }
 
         this.updateTranslations();
@@ -45,12 +45,12 @@ FluidbookL10N.prototype = {
     getActiveLang: function () {
         var res = this.lang;
         if (this.lang === 'default') {
-            res = this.fluidbook.datas.defaultLang;
+            res = this.fluidbook.settings.defaultLang;
         }
 
         // Append country when lang is present more than one time in the list
         if (undefined !== this._langsCount && this._langsCount[res] > 1) {
-            res += '_' + this.fluidbook.datas.country;
+            res += '_' + this.fluidbook.settings.country;
         }
         return res;
     },
@@ -74,17 +74,17 @@ FluidbookL10N.prototype = {
         }
 
         if (!force) {
-            if (this.fluidbook.datas.multilang == '') {
+            if (this.fluidbook.settings.multilang == '') {
                 return;
             }
-            if (this.fluidbook.datas.multiApp) {
+            if (this.fluidbook.settings.multiApp) {
                 return;
             }
         }
 
         this.multilangEnabled = true;
         var $this = this;
-        var ml = this.fluidbook.datas.multilang.replace(/\r/g, "\n").replace(/\n+/g, "\n");
+        var ml = this.fluidbook.settings.multilang.replace(/\r/g, "\n").replace(/\n+/g, "\n");
 
         var e = ml.split("\n");
         this._langsCount = {};
@@ -151,7 +151,7 @@ FluidbookL10N.prototype = {
             return name;
         }
 
-        switch (this.fluidbook.datas.multilangDisplay) {
+        switch (this.fluidbook.settings.multilangDisplay) {
             case 'lang':
                 name = details.langName;
                 break;
index 388fa08001ec6ab3b5220aa18e197d5d7323c164..7ec58b7d1b3e28147695754ade2831352a3fecb9 100644 (file)
@@ -9,7 +9,7 @@ FluidbookLandingPage.prototype = {
     init: function () {
         var $this = this;
 
-        if (this.fluidbook.datas.landingPage != undefined && this.fluidbook.datas.landingPage != '') {
+        if (this.fluidbook.settings.landingPage != undefined && this.fluidbook.settings.landingPage != '') {
             this.hasLandingPage = true;
         }
 
index f24d6845c67aa3ccdc11cc0b82365163cc73a879..3cd475cdb3820d94ad4b3bd260416f17c55bb44d 100644 (file)
@@ -75,7 +75,7 @@ FluidbookLinks.prototype = {
                 return true;
             }
 
-            if (!navigator.onLine && external && $this.fluidbook.datas.phonegap) {
+            if (!navigator.onLine && external && $this.fluidbook.settings.phonegap) {
                 $this.fluidbook.alertInternetRequired();
                 e.preventDefault();
                 e.stopPropagation();
@@ -87,7 +87,7 @@ FluidbookLinks.prototype = {
                 target = '_system';
             }
 
-            if ($this.fluidbook.datas.phonegap === 'android' && $(this).data('type') === 16 && !external) {
+            if ($this.fluidbook.settings.phonegap === 'android' && $(this).data('type') === 16 && !external) {
                 var url = $(this).attr('href')
                 $this.fluidbook._openFile($this.fluidbook.relativeToAbsolute(url), $("body"), 'pdf');
                 return;
@@ -210,12 +210,12 @@ FluidbookLinks.prototype = {
 
         var rightContainer = links.find('.rightContainer');
         var leftContainer = links.find('.leftContainer');
-        rightContainer.html(this.fluidbook.datas.links[rightPage]);
-        leftContainer.html(this.fluidbook.datas.links[leftPage]);
+        rightContainer.html(this.fluidbook.settings.links[rightPage]);
+        leftContainer.html(this.fluidbook.settings.links[leftPage]);
 
-        if (this.fluidbook.datas.bookmark) {
-            leftContainer.append(this.fluidbook.bookmarks.getBookmarkForPage(leftPage, this.fluidbook.displayOnePage, this.fluidbook.datas.bookmarkPermanentIcon));
-            rightContainer.append(this.fluidbook.bookmarks.getBookmarkForPage(rightPage, this.fluidbook.displayOnePage, this.fluidbook.datas.bookmarkPermanentIcon));
+        if (this.fluidbook.settings.bookmark) {
+            leftContainer.append(this.fluidbook.bookmarks.getBookmarkForPage(leftPage, this.fluidbook.displayOnePage, this.fluidbook.settings.bookmarkPermanentIcon));
+            rightContainer.append(this.fluidbook.bookmarks.getBookmarkForPage(rightPage, this.fluidbook.displayOnePage, this.fluidbook.settings.bookmarkPermanentIcon));
         }
 
         if (this.fluidbook.displayOnePage) {
@@ -253,7 +253,7 @@ FluidbookLinks.prototype = {
     },
 
     animateLinks: function () {
-        if (this.fluidbook.datas.linkBlinkTime == 0 || this.fluidbook.datas.linkBlinkRepetition == 0 || !this.fluidbook.datas.mobileLinksRevealAnim) {
+        if (this.fluidbook.settings.linkBlinkTime == 0 || this.fluidbook.settings.linkBlinkRepetition == 0 || !this.fluidbook.settings.mobileLinksRevealAnim) {
             return;
         }
         var $this = this;
@@ -448,12 +448,12 @@ FluidbookLinks.prototype = {
     },
 
     getLinkDataById: function (uid) {
-        return this.fluidbook.datas.linksData[uid];
+        return this.fluidbook.settings.linksData[uid];
     },
 
     getLinkByHref: function (href) {
-        for (var i = 1; i <= this.fluidbook.datas.pages; i++) {
-            var res = $(this.fluidbook.datas.links[i]).find('a[href="' + href + '"]');
+        for (var i = 1; i <= this.fluidbook.settings.pages; i++) {
+            var res = $(this.fluidbook.settings.links[i]).find('a[href="' + href + '"]');
             if (res.length > 0) {
                 return res.eq('0');
             }
@@ -474,7 +474,7 @@ FluidbookLinks.prototype = {
             return;
         }
 
-        var animateBookmarks = (this.fluidbook.datas.bookmarkBlinkOnPageChange == true);
+        var animateBookmarks = (this.fluidbook.settings.bookmarkBlinkOnPageChange == true);
 
         var $this = this;
         var links = $(container).find(".link a.displayArea");
@@ -509,12 +509,12 @@ FluidbookLinks.prototype = {
 
         var speed = 0.5;
         var timeline = new TimelineMax();
-        var repetitions = this.fluidbook.datas.linkBlinkRepetition - 1;
+        var repetitions = this.fluidbook.settings.linkBlinkRepetition - 1;
         el.addClass('animating');
         var d = 0.1;
         if (repetitions > 0) {
             el.css('opacity', 0);
-            timeline.add(TweenMax.to(el, this.fluidbook.datas.linkBlinkTime * speed, {
+            timeline.add(TweenMax.to(el, this.fluidbook.settings.linkBlinkTime * speed, {
                 delay: 0.1,
                 opacity: 1,
                 ease: Linear.easeNone
@@ -524,16 +524,16 @@ FluidbookLinks.prototype = {
             el.css('opacity', 1);
         }
         for (var i = 0; i < repetitions; i++) {
-            timeline.add(TweenMax.to(el, this.fluidbook.datas.linkBlinkTime * speed, {
+            timeline.add(TweenMax.to(el, this.fluidbook.settings.linkBlinkTime * speed, {
                 opacity: 0.5,
                 ease: Linear.easeNone
             }));
-            timeline.add(TweenMax.to(el, this.fluidbook.datas.linkBlinkTime * speed, {
+            timeline.add(TweenMax.to(el, this.fluidbook.settings.linkBlinkTime * speed, {
                 opacity: 1,
                 ease: Linear.easeNone
             }));
         }
-        timeline.add(TweenMax.to(el, this.fluidbook.datas.linkBlinkTime, {
+        timeline.add(TweenMax.to(el, this.fluidbook.settings.linkBlinkTime, {
             delay: d,
             opacity: 0,
             onComplete: _complete
@@ -617,7 +617,7 @@ FluidbookLinks.prototype = {
                 });
             }, 100);
 
-        }, parseFloat(this.fluidbook.datas.inlineSlideshowDuration) * 1000));
+        }, parseFloat(this.fluidbook.settings.inlineSlideshowDuration) * 1000));
     }
     ,
 
index 207eb07c9940bd8d90fd50c691c95c500f9ffe40..8f4c3ecf7fdc0f924bc6b19e9c67daa6bdd4d07e 100644 (file)
@@ -24,7 +24,7 @@ FluidbookLoader.prototype = {
     },
 
     getPageDimensions: function (page, width) {
-        var dim = this.fluidbook.datas.pagesDimensions[page];
+        var dim = this.fluidbook.settings.pagesDimensions[page];
         if (dim === undefined) {
 
         }
@@ -40,10 +40,10 @@ FluidbookLoader.prototype = {
 
     getVersionToLoad: function (page) {
         if (this.fluidbook.vectorTexts) {
-            if (this.fluidbook.datas.vectorPages.indexOf(page) >= 0) {
+            if (this.fluidbook.settings.vectorPages.indexOf(page) >= 0) {
                 return 'vector';
             }
-            if (this.fluidbook.datas.rasterizePages.indexOf(page) === -1) {
+            if (this.fluidbook.settings.rasterizePages.indexOf(page) === -1) {
                 return 'textasvector';
             }
         }
@@ -265,7 +265,7 @@ FluidbookLoader.prototype = {
         }
     },
     loadPage: function (pageNr, doublePage, position, callback) {
-        if (pageNr <= 0 || pageNr > this.fluidbook.datas.pages) {
+        if (pageNr <= 0 || pageNr > this.fluidbook.settings.pages) {
             callback();
             return;
         }
@@ -298,7 +298,7 @@ FluidbookLoader.prototype = {
             }
 
             $(page).children(".shade").html(this.loadPageShade(position));
-            $(page).children('.clinks').html(this.fluidbook.datas.clinks[pageNr]);
+            $(page).children('.clinks').html(this.fluidbook.settings.clinks[pageNr]);
             callback();
             return;
         }
@@ -315,17 +315,17 @@ FluidbookLoader.prototype = {
             $(page).addClass(position);
 
             shade = 'shade' + position;
-            if ($this.fluidbook.datas.pageReflection) {
+            if ($this.fluidbook.settings.pageReflection) {
                 shade += '-reflet';
             }
             shade += '.png';
-            $(page).children('.clinks').html($this.fluidbook.datas.clinks[pageNr]);
+            $(page).children('.clinks').html($this.fluidbook.settings.clinks[pageNr]);
             $(page).children(".shade").html($this.loadPageShade(position));
             callback();
         });
     },
     loadPageShade: function (position) {
-        return this.loadImage('images/shadows/pages/' + position + '.png', this.fluidbook.datas.width / 4, this.fluidbook.datas.height);
+        return this.loadImage('images/shadows/pages/' + position + '.png', this.fluidbook.settings.width / 4, this.fluidbook.settings.height);
     },
     loadLeftPage: function (page, doublePage, callback) {
         if (page > 0 && page <= this.fluidbook.contentlock.getMaxPage()) {
@@ -373,7 +373,7 @@ FluidbookLoader.prototype = {
         }
     },
     _loadBackground: function (page, callback) {
-        if (page <= 0 || page > this.fluidbook.datas.pages) {
+        if (page <= 0 || page > this.fluidbook.settings.pages) {
             callback();
             return;
         }
@@ -391,7 +391,7 @@ FluidbookLoader.prototype = {
         }
     },
     __loadBackground: function (page, callback) {
-        if (page <= 0 || page > this.fluidbook.datas.pages) {
+        if (page <= 0 || page > this.fluidbook.settings.pages) {
             callback();
             return;
         }
@@ -403,7 +403,7 @@ FluidbookLoader.prototype = {
         this.backgrounds[page] = this.loadImage(url, null, null, null, page, callback);
     },
     loadTexture: function (page, callback) {
-        if (page <= 0 || page > this.fluidbook.datas.pages) {
+        if (page <= 0 || page > this.fluidbook.settings.pages) {
             callback();
             return;
         }
@@ -420,7 +420,7 @@ FluidbookLoader.prototype = {
     },
 
     _loadTexture: function (page, callback) {
-        if (page <= 0 || page > this.fluidbook.datas.pages) {
+        if (page <= 0 || page > this.fluidbook.settings.pages) {
             callback();
             return;
         }
@@ -433,8 +433,8 @@ FluidbookLoader.prototype = {
         var ctx = c.getContext("2d");
         ctx.clearRect(0, 0, d, d);
 
-        var wr = d / $this.fluidbook.datas.width;
-        var hr = d / $this.fluidbook.datas.height;
+        var wr = d / $this.fluidbook.settings.width;
+        var hr = d / $this.fluidbook.settings.height;
 
         // Draw background
         if (this.backgrounds[page] !== undefined && this.backgrounds[page] !== null) {
@@ -458,7 +458,7 @@ FluidbookLoader.prototype = {
         }
 
         // Draw content links
-        var clinks = this.fluidbook.datas.clinks[page];
+        var clinks = this.fluidbook.settings.clinks[page];
         if (clinks !== '') {
             $("body").append('<div id="texture_clinks">' + clinks + '</div>');
             $("#texture_clinks .contentLink").each(function () {
@@ -478,7 +478,7 @@ FluidbookLoader.prototype = {
         }
 
         // Draw the shadow if necessary
-        if (this.fluidbook.datas.shadeAlpha > 0) {
+        if (this.fluidbook.settings.shadeAlpha > 0) {
             var sw = d * .25;
             var s, x;
             if (page % 2 === 0) {
@@ -490,7 +490,7 @@ FluidbookLoader.prototype = {
                 s = this.shadeRight;
                 x = 0;
             }
-            ctx.globalAlpha = 2 * this.fluidbook.datas.shadeAlpha / 100;
+            ctx.globalAlpha = 2 * this.fluidbook.settings.shadeAlpha / 100;
             ctx.drawImage(s.get(0), x, 0, sw, d);
             ctx.globalAlpha = 1;
         }
@@ -516,7 +516,7 @@ FluidbookLoader.prototype = {
     },
 
     loadTexts: function (pageNr, callback) {
-        if (pageNr <= 0 || pageNr > this.fluidbook.datas.pages) {
+        if (pageNr <= 0 || pageNr > this.fluidbook.settings.pages) {
             callback();
             return;
         }
@@ -538,7 +538,7 @@ FluidbookLoader.prototype = {
         }
     },
     _loadTexts: function (pageNr, callback) {
-        if (pageNr <= 0 || pageNr > this.fluidbook.datas.pages) {
+        if (pageNr <= 0 || pageNr > this.fluidbook.settings.pages) {
             callback();
             return;
         }
@@ -558,7 +558,7 @@ FluidbookLoader.prototype = {
     },
 
     checkLoadedThumbs: function () {
-        var res = this.loadedThumbnails.length === this.fluidbook.datas.pages;
+        var res = this.loadedThumbnails.length === this.fluidbook.settings.pages;
         return res;
     },
 
@@ -573,7 +573,7 @@ FluidbookLoader.prototype = {
         var cb = function () {
 
         };
-        for (var i = 1; i <= this.fluidbook.datas.pages; i++) {
+        for (var i = 1; i <= this.fluidbook.settings.pages; i++) {
             this.loadThumb(i, cb);
         }
     },
@@ -587,7 +587,7 @@ FluidbookLoader.prototype = {
     },
 
     _loadThumb: function (pageNr, callback) {
-        if (pageNr <= 0 || pageNr > this.fluidbook.datas.pages) {
+        if (pageNr <= 0 || pageNr > this.fluidbook.settings.pages) {
             callback();
             return;
         }
index 0f35f008eebbaf8f8f52723616e300ce863a1509..b7a92808ea581bdbaccf4a73319655756cd91e76 100644 (file)
@@ -17,7 +17,7 @@ FluidbookMenu.prototype = {
             return false;
         });
 
-        if (this.fluidbook.datas.displayChaptersAtStart) {
+        if (this.fluidbook.settings.displayChaptersAtStart) {
             $(this.fluidbook).on('fluidbook.splash.hide', function () {
                 $this.openView('chapters', '', '', function () {
 
@@ -157,8 +157,8 @@ FluidbookMenu.prototype = {
         var links = '';
         var animateLinks = false;
         var uid = $(a).closest('[data-id]').data('id');
-        if (this.fluidbook.datas.links['link_' + uid] !== undefined) {
-            links = '<div class="links">' + this.fluidbook.datas.links['link_' + uid] + '</div>';
+        if (this.fluidbook.settings.links['link_' + uid] !== undefined) {
+            links = '<div class="links">' + this.fluidbook.settings.links['link_' + uid] + '</div>';
             animateLinks = true;
         }
         view += '<div class="content"><div class="multimediaHolder"><div class="multimediaScale">';
@@ -301,7 +301,7 @@ FluidbookMenu.prototype = {
         } else if (service == 'vimeo') {
             view += '<iframe class="webvideo" type="text/html" src="https://player.vimeo.com/video/' + video + '?autoplay=1" width="100%" frameborder="0"></iframe>';
         } else if (service == 'brightcove') {
-            view += '<iframe class="webvideo" type="text/html" src="./video/brightcove.html?pid=' + this.fluidbook.datas.brightcovePlayerId + '&pk=' + encodeURIComponent(DATAS.brightcovePlayerSecret) + '&vid=' + video + '" width="100%" frameborder="0"></iframe>'
+            view += '<iframe class="webvideo" type="text/html" src="./video/brightcove.html?pid=' + this.fluidbook.settings.brightcovePlayerId + '&pk=' + encodeURIComponent(this.fluidbook.settings.brightcovePlayerSecret) + '&vid=' + video + '" width="100%" frameborder="0"></iframe>'
         }
         view += '</div>';
         $("#view").append('<div class="mview" data-menu="webvideo">' + view + '</div>');
@@ -320,17 +320,17 @@ FluidbookMenu.prototype = {
         Object.keys(this.fluidbook.l10n.multilang).forEach(function (langCode) {
             var v = this.fluidbook.l10n.multilang[langCode];
             var url = v.url;
-            if (url.substr(0, 3) == '../' && !$this.fluidbook.datas.alwaysHTML5 && !$this.fluidbook.datas.standalone && !$this.fluidbook.support.offline) {
+            if (url.substr(0, 3) == '../' && !$this.fluidbook.settings.alwaysHTML5 && !$this.fluidbook.settings.standalone && !$this.fluidbook.support.offline) {
                 url = '../' + url;
             }
-            /*'datas' => array(__('Langue') => 'lang',
+            /*'settings' => array(__('Langue') => 'lang',
              __('Langue') . ' (' . __('Pays') . ')' => 'lang_country',
              __('Pays') . ' (' . __('Langue') . ')' => 'country_lang'));*/
 
             var name = $this.fluidbook.l10n.getLanguageName(langCode);
 
             var c = '';
-            if ($this.fluidbook.datas.phonegap) {
+            if ($this.fluidbook.settings.phonegap) {
                 view += '<li data-level="0"><a href="#" data-id="' + url + '" data-locale="' + v.lang + '" class="level0 appswitchlocale"><img src="images/flags/' + v.flag + '.png" alt="' + name + '" /><span dir="' + $this.fluidbook.l10n.getLanguageDirection(langCode) + '">' + name + '</span></a></li>';
             } else {
                 view += '<li data-level="0"><a href="' + url + '" class="level0"><img src="images/flags/' + v.flag + '.png" alt="' + name + '" /><span dir="' + $this.fluidbook.l10n.getLanguageDirection(langCode) + '">' + name + '</span></a></li>';
@@ -409,13 +409,13 @@ FluidbookMenu.prototype = {
         }
     },
     openChapters: function (submenu, callback) {
-        if (this.fluidbook.datas.externalChaptersHTML != '') {
+        if (this.fluidbook.settings.externalChaptersHTML != '') {
             this.openExternalChapters(callback);
             return;
         }
 
         if (this.fluidbook.chapters == undefined) {
-            this.fluidbook.chapters = new FluidbookChapters(this.fluidbook, this.fluidbook.datas.chapters);
+            this.fluidbook.chapters = new FluidbookChapters(this.fluidbook, this.fluidbook.settings.chapters);
         }
 
         if (submenu == undefined) {
@@ -426,11 +426,11 @@ FluidbookMenu.prototype = {
         var menuId = 'mview-chapters-' + v.sub;
 
         var c = '';
-        if (this.fluidbook.datas.chaptersCaptionDisplay === false) {
+        if (this.fluidbook.settings.chaptersCaptionDisplay === false) {
             c += ' h0';
         }
         var view = '<div class="caption' + c + '">' + this.closeButton();
-        if (this.fluidbook.datas.chaptersCaptionDisplay !== false) {
+        if (this.fluidbook.settings.chaptersCaptionDisplay !== false) {
             view += '<h2>' + v.title + '</h2>';
         }
 
@@ -454,7 +454,7 @@ FluidbookMenu.prototype = {
     openExternalChapters: function (callback) {
         var view = '<div class="caption">' + this.closeButton() + '</div>';
         view += '<div class="content"><div class="multimediaHolder"><div class="multimediaScale">';
-        view += '<iframe data-width="' + this.fluidbook.datas.externalChaptersSize.width + '" data-height="' + this.fluidbook.datas.externalChaptersSize.height + '"  width="' + this.fluidbook.datas.externalChaptersSize.width + '" height="' + this.fluidbook.datas.externalChaptersSize.height + '" src="data/chapters/index.html" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
+        view += '<iframe data-width="' + this.fluidbook.settings.externalChaptersSize.width + '" data-height="' + this.fluidbook.settings.externalChaptersSize.height + '"  width="' + this.fluidbook.settings.externalChaptersSize.width + '" height="' + this.fluidbook.settings.externalChaptersSize.height + '" src="data/chapters/index.html" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
         view += '</div></div></div>';
 
         var read = ' data-readmode="1"';
@@ -469,7 +469,7 @@ FluidbookMenu.prototype = {
     },
     openArchives: function (title, callback) {
         var archives = '<div class="caption">' + this.closeButton() + '<h2>' + title + '</h2></div>';
-        archives += '<div class="image" id="archivesview"><img src="data/images/' + this.fluidbook.datas.externalArchives + '" /><div class="links">' + this.fluidbook.datas.links.archives + '</div></div>';
+        archives += '<div class="image" id="archivesview"><img src="data/images/' + this.fluidbook.settings.externalArchives + '" /><div class="links">' + this.fluidbook.settings.links.archives + '</div></div>';
         $("#view").append('<div class="mview archives" data-menu="archives">' + archives + '</div>');
         if (callback != undefined) {
             callback();
@@ -596,29 +596,29 @@ FluidbookMenu.prototype = {
 
         switch (m.data('menu')) {
             case 'chapters':
-                hasCaption = this.fluidbook.datas.chaptersCaptionDisplay !== false;
-                this.fluidbook.datas.chaptersColumns = Math.max(1, Math.min(6, this.fluidbook.datas.chaptersColumns));
-                if (this.fluidbook.datas.chaptersCascade) {
-                    this.fluidbook.datas.chaptersColumns = 1;
+                hasCaption = this.fluidbook.settings.chaptersCaptionDisplay !== false;
+                this.fluidbook.settings.chaptersColumns = Math.max(1, Math.min(6, this.fluidbook.settings.chaptersColumns));
+                if (this.fluidbook.settings.chaptersCascade) {
+                    this.fluidbook.settings.chaptersColumns = 1;
                 }
 
                 var w;
-                if (this.fluidbook.datas.chaptersColumns > 1) {
-                    w = this.fluidbook.datas.chaptersColMaxWidth * this.fluidbook.datas.chaptersColumns;
+                if (this.fluidbook.settings.chaptersColumns > 1) {
+                    w = this.fluidbook.settings.chaptersColMaxWidth * this.fluidbook.settings.chaptersColumns;
                 } else {
-                    w = Math.min(450, this.fluidbook.datas.chaptersColMaxWidth);
+                    w = Math.min(450, this.fluidbook.settings.chaptersColMaxWidth);
                 }
                 fullscreen = (w >= ww * 0.9);
                 if (fullscreen) {
                     w = ww;
                 }
-                if (this.fluidbook.datas.chaptersCascade) {
+                if (this.fluidbook.settings.chaptersCascade) {
                     h = hh * 0.8;
                     forceHeight = true;
                 }
 
-                if (this.fluidbook.datas.chaptersColumns > 1) {
-                    if (w < this.fluidbook.datas.chaptersColMaxWidth * this.fluidbook.datas.chaptersColumns) {
+                if (this.fluidbook.settings.chaptersColumns > 1) {
+                    if (w < this.fluidbook.settings.chaptersColMaxWidth * this.fluidbook.settings.chaptersColumns) {
                         $('.mview[data-menu=chapters] ul.chapters').addClass('onecolumn');
                     } else {
                         $('.mview[data-menu=chapters] ul.chapters').removeClass('onecolumn');
@@ -627,14 +627,14 @@ FluidbookMenu.prototype = {
 
                 break;
             case 'text':
-                w = parseInt(this.fluidbook.datas.textPopupWidth);
+                w = parseInt(this.fluidbook.settings.textPopupWidth);
                 fullscreen = (w >= ww * 0.9);
                 break;
             case 'index':
                 var indexWidth = Math.floor(ww / 230) * 230;
                 $(".indexViewHolder").css('width', indexWidth);
                 if (this.fluidbook.mobilefirst.enabled) {
-                    var cw = 10 + 130 * this.fluidbook.datas.pages;
+                    var cw = 10 + 130 * this.fluidbook.settings.pages;
                     fullscreen = (cw >= ww * 0.9);
                     if (!fullscreen) {
                         w = Math.max(400, cw + 30);
@@ -651,8 +651,8 @@ FluidbookMenu.prototype = {
                 break;
             case 'iframe':
                 w = ww * 0.8;
-                if (parseInt(this.fluidbook.datas.iframePopupMaxWidth) > 0) {
-                    w = Math.min(w, parseInt(this.fluidbook.datas.iframePopupMaxWidth));
+                if (parseInt(this.fluidbook.settings.iframePopupMaxWidth) > 0) {
+                    w = Math.min(w, parseInt(this.fluidbook.settings.iframePopupMaxWidth));
                 }
                 h = hh * 0.8;
                 if (ww < 800) {
@@ -891,7 +891,7 @@ FluidbookMenu.prototype = {
 
                 // If the option to print the full brochure is disabled,
                 // we change the print dialogue to a 2 column mode and narrower width
-                if (!this.fluidbook.datas.printFullBrochure) {
+                if (!this.fluidbook.settings.printFullBrochure) {
                     w = 560;
                 }
                 if (m.find('.print-dialogue').hasClass('compact')) {
@@ -970,7 +970,7 @@ FluidbookMenu.prototype = {
         });
 
         if ($("#archivesview").length == 1) {
-            var w = this.fluidbook.datas.filesInfos.archives.width;
+            var w = this.fluidbook.settings.filesInfos.archives.width;
             var ratio = $("#archivesview img").width() / w;
             $("#archivesview .links").transform({scale: [ratio]});
         }
index b9251300f1e6cd2d8a69a21271798bd2ace9a1a2..26907c12f58e75b5e57355c3e1b444c83edc772d 100644 (file)
@@ -1,11 +1,11 @@
 function FluidbookMobileFirst(fluidbook) {
     this.fluidbook = fluidbook;
     this.isScrolling = false;
-    this.enabled = this.fluidbook.datas.mobileNavigationType === 'mobilefirst';
+    this.enabled = this.fluidbook.settings.mobileNavigationType === 'mobilefirst';
     this.transitioning = false;
     this.firstReveal = true;
     if (this.enabled) {
-        this.fluidbook.datas.logoHideWhenOverriden = false;
+        this.fluidbook.settings.logoHideWhenOverriden = false;
         this.fluidbook.displayOnePage = true;
         $("#fluidbook").wrap('<div id="scroll"></div>');
         this.init();
@@ -39,7 +39,7 @@ FluidbookMobileFirst.prototype = {
             $("#pages .mf-nav").removeClass('hiddenzoom');
         });
 
-        this.fluidbook.datas.soundTheme = '';
+        this.fluidbook.settings.soundTheme = '';
     },
 
     checkScroll: function () {
@@ -158,7 +158,7 @@ FluidbookMobileFirst.prototype = {
     },
 
     getBookScale: function (aw) {
-        return Math.min(620, aw) / this.fluidbook.datas.width;
+        return Math.min(620, aw) / this.fluidbook.settings.width;
     },
 
     getFooterNavigation: function (page) {
@@ -167,7 +167,7 @@ FluidbookMobileFirst.prototype = {
         if (visibility.previous) {
             footer += '<a class="previous" href="#/page/' + (page - 1) + '">' + getSpriteIcon('interface-previous-simple') + __('Previous') + '</a>';
         }
-        footer += '<div class="pagenumbers">' + page + '/' + this.fluidbook.datas.pages + '</div>';
+        footer += '<div class="pagenumbers">' + page + '/' + this.fluidbook.settings.pages + '</div>';
         if (visibility.next) {
             footer += '<a class="next" href="#/page/' + (page + 1) + '">' + __('Next') + getSpriteIcon('interface-next-simple') + '</a>';
         }
index 8b4d46a2d318fa1ac142cb7474136147602cebcc..1861c3c40c050794b41508ce61b789810a486065 100644 (file)
@@ -1,6 +1,6 @@
 function FluidbookNav(fluidbook) {
     this.fluidbook = fluidbook;
-    this._dimensions = this.fluidbook.datas.iconsDimensions;
+    this._dimensions = this.fluidbook.settings.iconsDimensions;
     this.menuIsOpen = false;
     this.chaptersMenuHTML = '';
     this.searchHTML = '';
@@ -17,7 +17,7 @@ FluidbookNav.prototype = {
     initMenu: function () {
         var $this = this,
             dir = this.fluidbook.l10n.dir,
-            inverted = this.fluidbook.datas.invertMenuPosition,
+            inverted = this.fluidbook.settings.invertMenuPosition,
             side = ((dir === 'ltr' && inverted) || (dir === 'rtl' && !inverted)) ? 'right' : 'left';
 
         var extensions = ['pagedim-black', 'position-front'];
@@ -31,7 +31,7 @@ FluidbookNav.prototype = {
             // Ref: https://github.com/FrDH/jQuery.mmenu/issues/687#issuecomment-279377172
             onClick: {
                 close: function () {
-                    if (fluidbook.datas.phonegap === 'ios') {
+                    if (fluidbook.settings.phonegap === 'ios') {
                         return !$(this).is('#menu_download,#menu_print');
                     }
                     return true;
@@ -249,10 +249,10 @@ FluidbookNav.prototype = {
          * __('switch on the sound')
          */
         var $this = this,
-            navOrder = this.fluidbook.datas.navOrder; // Default desktop order, maybe be overridden later
+            navOrder = this.fluidbook.settings.navOrder; // Default desktop order, maybe be overridden later
 
         var v2 = '';
-        if (this.fluidbook.datas.iconSet < 15) {
+        if (this.fluidbook.settings.iconSet < 15) {
             v2 = ' class="v2"';
         }
 
@@ -260,8 +260,8 @@ FluidbookNav.prototype = {
         if (navType === 'menu') {
 
             // Use navOrderH (mobile icon order) if it is set
-            if (this.fluidbook.datas.navOrderH.length > 0) {
-                navOrder = this.fluidbook.datas.navOrderH;
+            if (this.fluidbook.settings.navOrderH.length > 0) {
+                navOrder = this.fluidbook.settings.navOrderH;
             }
 
             var menuOpener = '<a href="#" id="menuOpener">' + getSpriteIcon('interface-menu') + '<span class="label">' + this.fluidbook.l10n.__('Menu') + '</span></a>';
@@ -271,7 +271,7 @@ FluidbookNav.prototype = {
             $nav.append('<ul id="menuList"' + v2 + '></ul>');
 
             // Add Search form
-            var searchElement = (this.fluidbook.datas.search) ? this.getSearch() : '';
+            var searchElement = (this.fluidbook.settings.search) ? this.getSearch() : '';
             this.searchHTML = '<div id="menuSearch">' + searchElement + '</div>'; // Save for later so it can be injected after MMenu is rendered
 
             // Horizontal icon nav
@@ -287,8 +287,8 @@ FluidbookNav.prototype = {
             var forceHome = (window.localStorage.getItem('home') === '1');
 
             if (forceHome) {
-                if (this.fluidbook.datas.navOrder.indexOf('home') === -1) {
-                    this.fluidbook.datas.navOrder.unshift('home');
+                if (this.fluidbook.settings.navOrder.indexOf('home') === -1) {
+                    this.fluidbook.settings.navOrder.unshift('home');
                 }
             }
         } catch (err) {
@@ -348,9 +348,9 @@ FluidbookNav.prototype = {
             var link2 = null;
 
             if (icon === 'home' && !skipHome) {
-                var homeURL = this.fluidbook.datas.home;
+                var homeURL = this.fluidbook.settings.home;
                 var homeRequireLoader = true;
-                if (this.fluidbook.datas.home === '%apphome%' || forceHome && DATAS.phonegap) {
+                if (this.fluidbook.settings.home === '%apphome%' || forceHome && this.fluidbook.settings.phonegap) {
                     homeURL = decodeURIComponent(window.localStorage.getItem('apphome'));
                 }
                 if ($_GET['home'] !== undefined) {
@@ -390,21 +390,21 @@ FluidbookNav.prototype = {
             } else if (icon === 'index') {
                 link = this.addLink(navType, 'nav-index', '#/index', 'index', 'overview', 'overview');
             } else if (icon === 'chapters') {
-                if (!this.fluidbook.datas.displayChaptersIcon) {
+                if (!this.fluidbook.settings.displayChaptersIcon) {
                     continue;
                 }
-                if (this.fluidbook.datas.externalChaptersHTML) {
+                if (this.fluidbook.settings.externalChaptersHTML) {
                     link = this.addLink(navType, 'nav-chapters', '#/chapters', 'chapters', 'chapters', 'chapters');
-                } else if (this.fluidbook.datas.chaptersPage !== '') {
-                    link = this.addLink(navType, 'nav-chapters', '#/page/' + this.fluidbook.datas.chaptersPage, 'chapters', 'chapters', 'chapters');
-                } else if (this.fluidbook.datas.chapters.length > 0) {
+                } else if (this.fluidbook.settings.chaptersPage !== '') {
+                    link = this.addLink(navType, 'nav-chapters', '#/page/' + this.fluidbook.settings.chaptersPage, 'chapters', 'chapters', 'chapters');
+                } else if (this.fluidbook.settings.chapters.length > 0) {
                     // NOTE: Currently the MMenu breaks when the non-cascading chapter UL HTML is inserted so it will
                     // be opened in a popup for now. Todo: fix this so it works as a sub panel of it's own
-                    if (navType === 'menu' && this.fluidbook.datas.chaptersCascade && !this.fluidbook.datas.displayChaptersPopup) {
+                    if (navType === 'menu' && this.fluidbook.settings.chaptersCascade && !this.fluidbook.settings.displayChaptersPopup) {
                         link = this.addLink(navType, 'nav-chapters', '', 'chapters', 'chapters', 'chapters');
 
                         // Get HTML for submenus (appended later)
-                        this.chaptersMenuHTML = this.makeChapterLists(this.fluidbook.datas.chapters);
+                        this.chaptersMenuHTML = this.makeChapterLists(this.fluidbook.settings.chapters);
 
                     } else {
                         link = this.addLink(navType, 'nav-chapters', '#/chapters', 'chapters', 'chapters', 'chapters');
@@ -414,7 +414,7 @@ FluidbookNav.prototype = {
             } else if (icon === 'friend') {
                 if (this.fluidbook.share.isEnabled()) {
                     if (navType === 'horizontalNav') {
-                        if (this.fluidbook.datas.share) {
+                        if (this.fluidbook.settings.share) {
                             link = this.addLink(navType, 'nav-share', '#/share', 'share', 'share', 'share');
                         }
                     } else if (navType === 'menu') {
@@ -423,11 +423,11 @@ FluidbookNav.prototype = {
                     }
                 }
 
-            } else if (icon === 'bookmark' && this.fluidbook.datas.bookmark) {
+            } else if (icon === 'bookmark' && this.fluidbook.settings.bookmark) {
                 link = this.addLink(navType, 'nav-bookmarks', '#/bookmark', 'bookmarks', 'bookmarks', 'bookmarks');
-            } else if (icon === 'pdf' && this.fluidbook.datas.pdf) {
+            } else if (icon === 'pdf' && this.fluidbook.settings.pdf) {
                 link = this.addLink(navType, 'nav-download', '#', 'download', 'download', 'download');
-            } else if (icon === 'print' && this.fluidbook.datas.print) {
+            } else if (icon === 'print' && this.fluidbook.settings.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');
@@ -453,10 +453,10 @@ FluidbookNav.prototype = {
                 // Note: the "!" at the beginning of the title/help parameters means that we don't want these strings translated
                 link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language');
             } else if (icon === 'archives') {
-                if (this.fluidbook.datas.archivesLink !== '') {
-                    link = this.addLink(navType, 'nav-archives', this.fluidbook.datas.archivesLink, 'archives', '!' + this.fluidbook.datas.archivesLabel, '!' + this.fluidbook.datas.archivesLabel);
-                } else if (this.fluidbook.datas.externalArchives !== '') {
-                    link = this.addLink(navType, 'nav-archives', '#/archives', 'archives', '!' + this.fluidbook.datas.archivesLabel, '!' + this.fluidbook.datas.archivesLabel);
+                if (this.fluidbook.settings.archivesLink !== '') {
+                    link = this.addLink(navType, 'nav-archives', this.fluidbook.settings.archivesLink, 'archives', '!' + this.fluidbook.settings.archivesLabel, '!' + this.fluidbook.settings.archivesLabel);
+                } else if (this.fluidbook.settings.externalArchives !== '') {
+                    link = this.addLink(navType, 'nav-archives', '#/archives', 'archives', '!' + this.fluidbook.settings.archivesLabel, '!' + this.fluidbook.settings.archivesLabel);
                 }
 
             } else if (icon === 'help') {
@@ -466,7 +466,7 @@ FluidbookNav.prototype = {
                 link = this.addLink(navType, 'nav-zoomin', '#', 'zoomin', 'zoom in', 'zoom in');
                 link = this.addLink(navType, 'nav-zoomout', '#', 'zoomout', 'zoom out', 'zoom out');
 
-            } else if (icon === 'fullscreen' && this.fluidbook.support.fullscreen && !DATAS.phonegap) {
+            } else if (icon === 'fullscreen' && this.fluidbook.support.fullscreen && !this.fluidbook.settings.phonegap) {
                 link = this.addLink(navType, 'nav-' + icon, '#', icon, 'full screen', 'switch between fullscreen and normal');
 
             } else if (icon === 'sound' && this.fluidbook.sound.enabled) {
@@ -475,7 +475,7 @@ FluidbookNav.prototype = {
             } else if (icon === 'search') {
 
                 // Only the horizontal icon menu has the search icon, which opens the main menu
-                if (this.fluidbook.datas.search && navType === 'horizontalNav') {
+                if (this.fluidbook.settings.search && navType === 'horizontalNav') {
                     link = this.addLink(navType, 'nav-search', '#', 'searchIcon', 'search', 'search');
                 }
 
@@ -488,7 +488,7 @@ FluidbookNav.prototype = {
                     navLinkTarget = '';
 
                 // Check to see if navExtraLink is external or not and set target accordingly
-                if (typeof (this.fluidbook.datas.navExtraLink) === 'string' && this.fluidbook.datas.navExtraLink.lastIndexOf('http', 0) === 0) {
+                if (typeof (this.fluidbook.settings.navExtraLink) === 'string' && this.fluidbook.settings.navExtraLink.lastIndexOf('http', 0) === 0) {
                     navLinkTarget = ' target="_blank" rel="noopener noreferrer"';
                 }
 
@@ -497,13 +497,13 @@ FluidbookNav.prototype = {
                 }
 
                 if (navType === 'horizontalNav') {
-                    if (this.fluidbook.datas.navExtraImage !== '' && this.fluidbook.datas.navExtraLink !== '') {
-                        navExtraImage = this.fluidbook.datas.navExtraImage;
-                        link = '<a id="' + elementID + '" data-tooltip="' + this.fluidbook.datas.navExtraTooltip + '" href="' + this.fluidbook.datas.navExtraLink + '"' + navLinkTarget + '><img class="nav-icon" src="data/images/' + navExtraImage + '"></a>';
+                    if (this.fluidbook.settings.navExtraImage !== '' && this.fluidbook.settings.navExtraLink !== '') {
+                        navExtraImage = this.fluidbook.settings.navExtraImage;
+                        link = '<a id="' + elementID + '" data-tooltip="' + this.fluidbook.settings.navExtraTooltip + '" href="' + this.fluidbook.settings.navExtraLink + '"' + navLinkTarget + '><img class="nav-icon" src="data/images/' + navExtraImage + '"></a>';
                     }
-                } else if (navType === 'menu' && (this.fluidbook.datas.navExtraImage !== '' || this.fluidbook.datas.navExtraImageMobile !== '') && this.fluidbook.datas.navExtraLink !== '') {
-                    navExtraImage = this.fluidbook.datas.navExtraImageMobile || this.fluidbook.datas.navExtraImage; // Fallback to desktop image
-                    link = '<a id="' + elementID + '" href="' + this.fluidbook.datas.navExtraLink + '"' + navLinkTarget + '><img class="nav-icon" src="data/images/' + navExtraImage + '"> <span class="menu-item-title">' + this.fluidbook.datas.navExtraTooltip + '</span></a>';
+                } else if (navType === 'menu' && (this.fluidbook.settings.navExtraImage !== '' || this.fluidbook.settings.navExtraImageMobile !== '') && this.fluidbook.settings.navExtraLink !== '') {
+                    navExtraImage = this.fluidbook.settings.navExtraImageMobile || this.fluidbook.settings.navExtraImage; // Fallback to desktop image
+                    link = '<a id="' + elementID + '" href="' + this.fluidbook.settings.navExtraLink + '"' + navLinkTarget + '><img class="nav-icon" src="data/images/' + navExtraImage + '"> <span class="menu-item-title">' + this.fluidbook.settings.navExtraTooltip + '</span></a>';
                 }
 
                 if (link !== null) {
@@ -511,10 +511,10 @@ FluidbookNav.prototype = {
                 }
             } else if (icon.match(/extra\d/)) {
                 var n = icon.substr(5, 1);
-                var extraURL = this.fluidbook.datas['navExtraLink' + n];
-                var extraIcon = this.fluidbook.datas['navExtraIcon' + n];
-                var extraVisibility = this.fluidbook.datas['navExtraVisibility' + n];
-                var extraType = this.fluidbook.datas['navExtraType' + n];
+                var extraURL = this.fluidbook.settings['navExtraLink' + n];
+                var extraIcon = this.fluidbook.settings['navExtraIcon' + n];
+                var extraVisibility = this.fluidbook.settings['navExtraVisibility' + n];
+                var extraType = this.fluidbook.settings['navExtraType' + n];
                 if (extraURL === '' || extraIcon === '') {
                     continue;
                 }
@@ -566,7 +566,7 @@ FluidbookNav.prototype = {
                 if (extraURL.indexOf('link:') === 0) {
                     var linkId = extraURL.split(':', 2)[1];
                     var foundLink;
-                    $.each(this.fluidbook.datas.links, function (page, links) {
+                    $.each(this.fluidbook.settings.links, function (page, links) {
                         var l = $('<root>' + links + '</root>').find('[data-id="' + linkId + '"]');
                         if (l.length === 1) {
                             foundLink = l;
@@ -626,7 +626,7 @@ FluidbookNav.prototype = {
 
 
             // If the chapters menu is not cascading, wrap submenu lists in <div>s so that MMenu will show them in the same panel
-            if (!this.fluidbook.datas.chaptersCascade) {
+            if (!this.fluidbook.settings.chaptersCascade) {
 
                 // Create a single panel around the chapters
                 $('#chapterList').wrap('<div id="chaptersPanel" class="Panel"></div>');
@@ -650,9 +650,9 @@ FluidbookNav.prototype = {
             $(document).trigger('fluidbook.navigation.ready');
         }
 
-        if (this.fluidbook.datas.afterSearch !== '' && this.fluidbook.datas.afterSearchDisplayForHTML && this.fluidbook.datas.themeEnableAfterSearch && navType === 'horizontalNav') {
+        if (this.fluidbook.settings.afterSearch !== '' && this.fluidbook.settings.afterSearchDisplayForHTML && this.fluidbook.settings.themeEnableAfterSearch && navType === 'horizontalNav') {
             // Use the "afterSearch" image and links set in the theme and link editor
-            var afterSearchContent = '<div id="afterSearch"><div class="c">' + this.fluidbook.loader.getImage('data/images/' + this.fluidbook.datas.afterSearch) + '</div><div class="links">' + this.fluidbook.datas.links.aftersearch + '</div></li>';
+            var afterSearchContent = '<div id="afterSearch"><div class="c">' + this.fluidbook.loader.getImage('data/images/' + this.fluidbook.settings.afterSearch) + '</div><div class="links">' + this.fluidbook.settings.links.aftersearch + '</div></li>';
             $nav.after(afterSearchContent);
         }
 
@@ -679,7 +679,7 @@ FluidbookNav.prototype = {
 
         // Share icon
         $(document).on('click', '.icon-share', function () {
-            if ($this.fluidbook.datas.phonegap !== 'android') {
+            if ($this.fluidbook.settings.phonegap !== 'android') {
                 return true;
             }
             $this.fluidbook.share.intentShare();
@@ -691,7 +691,7 @@ FluidbookNav.prototype = {
             event.preventDefault();
 
             // Should we show complex PDF download options? Or just give them the full PDF?
-            if ($this.fluidbook.datas.pdfComplex && $this.fluidbook.datas.phonegap === false) {
+            if ($this.fluidbook.settings.pdfComplex && $this.fluidbook.settings.phonegap === false) {
                 $this.fluidbook.menu.openView('download');
             } else {
                 $this.fluidbook.downloadPDF($(this));
index b4a85609c6b5aaf3252d3702b33448591a130b0a..5d0aba9db34d0b0a0e40e53688534869ada310c4 100644 (file)
@@ -1,6 +1,6 @@
 function FluidbookPad(fluidbook) {\r
        this.fluidbook = fluidbook;\r
-       this.enabled = this.fluidbook.datas.mobileNavigationType == 'tab';\r
+       this.enabled = this.fluidbook.settings.mobileNavigationType == 'tab';\r
 \r
        if (this.enabled) {\r
                this.init();\r
index 342dc578352db50f45b108104683f4a58dab1ad2..e8894916078c33ce9c7d1a55e66c6d75fd32f9d6 100644 (file)
@@ -7,7 +7,7 @@ function FluidbookPageTransition(fluidbook) {
 
 FluidbookPageTransition.prototype = {
     init: function () {
-        if (this.fluidbook.support.transitions3dacc && this.fluidbook.datas.mobileTransitions === 'flip3d') {
+        if (this.fluidbook.support.transitions3dacc && this.fluidbook.settings.mobileTransitions === 'flip3d') {
             this.flip3d = new Fluidbook3DFlip(this.fluidbook);
         } else {
             this.flip3d = false;
@@ -32,7 +32,7 @@ FluidbookPageTransition.prototype = {
         } else if (type === 'flip3d') {
             return this.flip3d.animationTime;
         } else {
-            return parseFloat(this.fluidbook.datas.mobileTransitionDuration);
+            return parseFloat(this.fluidbook.settings.mobileTransitionDuration);
         }
     },
 
@@ -46,16 +46,16 @@ FluidbookPageTransition.prototype = {
             }
         }
         if (!this.fluidbook.support.transitions2d ||
-            this.fluidbook.datas.mobileTransitions === 'none') {
+            this.fluidbook.settings.mobileTransitions === 'none') {
             return 'immediate';
         }
         if (this.fluidbook.displayOnePage) {
             return 'portrait';
         }
-        if (!this.fluidbook.support.transitions3d && this.fluidbook.datas.mobileTransitions === 'flip') {
+        if (!this.fluidbook.support.transitions3d && this.fluidbook.settings.mobileTransitions === 'flip') {
             return 'slide';
         }
-        if (this.fluidbook.datas.mobileTransitions === 'slide') {
+        if (this.fluidbook.settings.mobileTransitions === 'slide') {
             return 'slide';
         }
         if (!this.fluidbook.support.transitions3dacc) {
@@ -65,7 +65,7 @@ FluidbookPageTransition.prototype = {
                 return 'flipcss';
             }
         }
-        if (this.fluidbook.support.transitions3dacc && this.fluidbook.datas.mobileTransitions === 'flip3d') {
+        if (this.fluidbook.support.transitions3dacc && this.fluidbook.settings.mobileTransitions === 'flip3d') {
             return 'flip3d';
         }
         return 'flipcss';
@@ -267,7 +267,7 @@ FluidbookPageTransition.prototype = {
         if (center) {
             if (newPage <= 1) {
                 res.center = -1;
-            } else if (this.fluidbook.datas.pages % 2 === 0 && newPage === this.fluidbook.datas.pages) {
+            } else if (this.fluidbook.settings.pages % 2 === 0 && newPage === this.fluidbook.settings.pages) {
                 res.center = 1;
             }
             if (this.fluidbook.l10n.dir === 'rtl') {
@@ -281,10 +281,10 @@ FluidbookPageTransition.prototype = {
     },
 
     centerBookEnabled: function () {
-        // if (this.fluidbook.support.transitions3dacc && this.fluidbook.datas.mobileTransitions === 'flip3d') {
+        // if (this.fluidbook.support.transitions3dacc && this.fluidbook.settings.mobileTransitions === 'flip3d') {
         //     return false;
         // }
-        return !!this.fluidbook.datas.centerBook && !this.fluidbook.displayOnePage && $('.tabslink').length === 0;
+        return !!this.fluidbook.settings.centerBook && !this.fluidbook.displayOnePage && $('.tabslink').length === 0;
     },
 
     centerBook: function (center, animationDuration) {
@@ -311,7 +311,7 @@ FluidbookPageTransition.prototype = {
             $(move).removeClass('animate');
         }
 
-        var delay = this.fluidbook.support.android ? this.fluidbook.datas.mobileTransitionDuration * 1000 : 10;
+        var delay = this.fluidbook.support.android ? this.fluidbook.settings.mobileTransitionDuration * 1000 : 10;
         setTimeout(function () {
             move.transform({translateX: left + 'px'});
         }, delay);
@@ -408,7 +408,7 @@ FluidbookPageTransition.prototype = {
 
         this.fluidbook.hideLoader();
         this.fluidbook.hideUnnecessaryButtons(page);
-        var animationDuration = transition <= 1 ? 0 : parseFloat(this.fluidbook.datas.mobileTransitionDuration);
+        var animationDuration = transition <= 1 ? 0 : parseFloat(this.fluidbook.settings.mobileTransitionDuration);
         this.fluidbook.updateShadows(page, animationDuration);
         this.centerBook(turning.center, animationDuration);
         $("#pagesnumbers").addClass('hidden');
@@ -453,7 +453,7 @@ FluidbookPageTransition.prototype = {
         $("#nextDoublePage").remove();
 
         if (this.fluidbook.pad.enabled) {
-            if (this.fluidbook.currentPage == this.fluidbook.datas.pages) {
+            if (this.fluidbook.currentPage == this.fluidbook.settings.pages) {
                 $("#down").css('opacity', 0);
             } else {
                 $("#down").css('opacity', 1);
index 6a47b70f2ed7b960f9ea9e3134cbc32335176403..030ecb4f8fef238434be26ebf7e6c75beedb47d5 100644 (file)
@@ -17,7 +17,7 @@ FluidbookPrint.prototype = {
             var element = $(this);
             var mode = element.data('mode'); // Either 'print' or 'download'
             var print = (mode === 'print');
-            var dynamicPDF = 'https://workshop.fluidbook.com/s/' + (print ? 'ep' : 'e') + '/' + $this.fluidbook.datas.cid + '/';
+            var dynamicPDF = 'https://workshop.fluidbook.com/s/' + (print ? 'ep' : 'e') + '/' + $this.fluidbook.settings.cid + '/';
             var leftPageNumber = $this.fluidbook.getPhysicalPageNumberOfSide('left');
             var rightPageNumber = $this.fluidbook.getPhysicalPageNumberOfSide('right');
             var choice = $('input[name="pageChoice"]:checked').val();
@@ -45,7 +45,7 @@ FluidbookPrint.prototype = {
                     if (isNaN(rangeStart) ||
                         isNaN(rangeEnd) ||
                         (rangeStart < 1) ||
-                        (rangeEnd > $this.fluidbook.datas.pages) ||
+                        (rangeEnd > $this.fluidbook.settings.pages) ||
                         (rangeStart > rangeEnd)
                     ) {
                         alert(__('Invalid page range. Please try again.'));
@@ -84,7 +84,7 @@ FluidbookPrint.prototype = {
         this.leftPageNumber = this.fluidbook.getPhysicalPageNumberOfSide('left');
         this.rightPageNumber = this.fluidbook.getPhysicalPageNumberOfSide('right');
         this.isFirstPage = (this.fluidbook.currentPage === 0);
-        this.isLastPage = (this.fluidbook.currentPage === this.fluidbook.datas.pages);
+        this.isLastPage = (this.fluidbook.currentPage === this.fluidbook.settings.pages);
         this.isSinglePageMode = (this.fluidbook.resize.orientation === 'portrait');
         this.buttonLabels = {
             'print': __('print'),
@@ -120,7 +120,7 @@ FluidbookPrint.prototype = {
         }
 
         // Full Brochure
-        if (this.fluidbook.datas.printFullBrochure) {
+        if (this.fluidbook.settings.printFullBrochure) {
             view += '<div class="print-option">';
             if (!this.compact) {
                 view += '<label for="allPages">';
@@ -137,7 +137,7 @@ FluidbookPrint.prototype = {
         }
 
         // Bookmarks
-        if (this.fluidbook.datas.bookmark) {
+        if (this.fluidbook.settings.bookmark) {
             var hasBookmarks = this.fluidbook.bookmarks.hasBookmarkedPages(),
                 bookmarksDisabled = hasBookmarks ? '' : 'disabled';
 
@@ -157,14 +157,14 @@ FluidbookPrint.prototype = {
         view += '<div class="print-option blank"></div>'; // Extra empty div to ensure flexbox space-between works as expected
 
         // Page range inputs
-        if (this.fluidbook.datas.printPageRange) {
+        if (this.fluidbook.settings.printPageRange) {
 
             // this.leftPageNumber may be false if on first page
             var rangeStart = Math.max(this.leftPageNumber, 1);
 
             // Current page + 1 unless we're out of range.
             // It has to be calculated this way because sometimes there is no this.rightPageNumber
-            var rangeEnd = Math.min(rangeStart + 1, this.fluidbook.datas.pages);
+            var rangeEnd = Math.min(rangeStart + 1, this.fluidbook.settings.pages);
 
             view += '<div class="print-option page-range-option">';
             view += '<input type="radio" name="pageChoice" value="range" id="pageRange">';
@@ -251,10 +251,10 @@ FluidbookPrint.prototype = {
     },
 
     advancedPrint: function () {
-        if (this.fluidbook.datas.phonegap !== false) {
+        if (this.fluidbook.settings.phonegap !== false) {
             return false;
         }
-        if (this.fluidbook.support.offline && !this.fluidbook.datas.offlineEnableAdvancedPrinting) {
+        if (this.fluidbook.support.offline && !this.fluidbook.settings.offlineEnableAdvancedPrinting) {
             return false;
         }
 
index 2af33eb4376945c224f2444b0c38de7eae023826..633ad581a22ffc210df14722ba104b912caeaa3f 100644 (file)
@@ -2,9 +2,9 @@ function FluidbookPrivacy(fluidbook) {
     this.fluidbook = fluidbook;
     this.storageKey = 'cookieConsent';
     if (location.host == 'workshop.fluidbook.com') {
-        this.storageKey = 'fluidbook.' + fluidbook.datas.id + '.' + this.storageKey;
+        this.storageKey = 'fluidbook.' + fluidbook.settings.id + '.' + this.storageKey;
     }
-    if (!this.fluidbook.datas.cookieConsent) {
+    if (!this.fluidbook.settings.cookieConsent) {
         return;
     }
     this.init();
@@ -26,11 +26,11 @@ FluidbookPrivacy.prototype = {
             return;
         }
         var $this = this;
-        $('body').append('<div id="cookieConsent"><a href="#" class="close"></a><p>' + this.fluidbook.datas.cookieConsentMessage + '</p></div>');
-        if (this.fluidbook.datas.cookieConsentAutoclose > 0) {
+        $('body').append('<div id="cookieConsent"><a href="#" class="close"></a><p>' + this.fluidbook.settings.cookieConsentMessage + '</p></div>');
+        if (this.fluidbook.settings.cookieConsentAutoclose > 0) {
             setTimeout(function () {
                 $this.close();
-            }, this.fluidbook.datas.cookieConsentAutoclose * 1000);
+            }, this.fluidbook.settings.cookieConsentAutoclose * 1000);
         }
         $(document).on('touchend click', "#cookieConsent a.close", function () {
             $this.close();
index 7b72f22d62135d1910fc282aef20b5a9065e4c87..2f3ceae58107137ea34a86c75fbb4124e9316788 100644 (file)
@@ -33,8 +33,8 @@ FluidbookResize.prototype = {
             marginX = 20;
         }
 
-        this.marginleft = marginX + parseInt(this.fluidbook.datas.extraXSpace);
-        this.margintop = marginY + parseInt(this.fluidbook.datas.extraYSpace);
+        this.marginleft = marginX + parseInt(this.fluidbook.settings.extraXSpace);
+        this.margintop = marginY + parseInt(this.fluidbook.settings.extraYSpace);
         this.marginbottom = marginY + marginV;
         this.marginright = this.marginleft;
     },
@@ -130,7 +130,7 @@ FluidbookResize.prototype = {
         this.interfaceScale = interfaceScale;
         this.headerScale = headerScale;
 
-        var navScale = headerScale * parseInt(this.fluidbook.datas.mobileNavScale) / 100;
+        var navScale = headerScale * parseInt(this.fluidbook.settings.mobileNavScale) / 100;
         this.navScale = navScale;
 
         var cssInterfaceScale = [interfaceScale, interfaceScale];
@@ -154,12 +154,12 @@ FluidbookResize.prototype = {
             marginLeft = 0;
             marginRight = 0;
         } else {
-            var extraX = parseInt(this.fluidbook.datas.mobileExtraXSpace);
+            var extraX = parseInt(this.fluidbook.settings.mobileExtraXSpace);
             if (isNaN(extraX)) {
                 extraX = 0;
             }
 
-            marginTop = (parseInt(this.fluidbook.datas.menuHeight) * headerScale) + (this.margintop * interfaceScale);
+            marginTop = (parseInt(this.fluidbook.settings.menuHeight) * headerScale) + (this.margintop * interfaceScale);
             marginBottom = (10 + this.marginbottom) * interfaceScale;
             marginLeft = (this.marginleft + parseInt(extraX)) * interfaceScale;
             marginRight = (this.marginright + parseInt(extraX)) * interfaceScale;
@@ -167,8 +167,8 @@ FluidbookResize.prototype = {
 
         var aw = this.ww - marginLeft - marginRight;
         var ah = this.hh - marginTop - marginBottom;
-        var fhh = this.fluidbook.datas.height;
-        var fww = this.fluidbook.datas.width;
+        var fhh = this.fluidbook.settings.height;
+        var fww = this.fluidbook.settings.width;
         if (this.orientation === 'landscape') {
             fww *= 2;
         }
@@ -222,7 +222,7 @@ FluidbookResize.prototype = {
         var pageNumberScale = Math.min(1, 1 / (this.bookScale / 0.5));
         $("#pagesnumbers").css('font-size', $("#pagesnumbers").data('size') * pageNumberScale);
 
-        if (this.fluidbook.datas.logoHideWhenOverriden) {
+        if (this.fluidbook.settings.logoHideWhenOverriden) {
             var availableWidthForLogo = (this.ww - fw) / 2;
             if ($("#logo").outerWidth() > availableWidthForLogo) {
                 $("#logo").addClass('overridenByFluidbook');
@@ -256,7 +256,7 @@ FluidbookResize.prototype = {
             'transform': 'translateY(-' + 50 * navScale + '%) scale(' + navScale + ')'
         });
 
-        var headerHeight = this.fluidbook.datas.menuHeight * navScale;
+        var headerHeight = this.fluidbook.settings.menuHeight * navScale;
         $('header').css({
             height: headerHeight,
             backgroundSize: '100% ' + headerHeight + 'px'
@@ -353,7 +353,7 @@ FluidbookResize.prototype = {
 
     resizeAfterSearch: function () {
         var rect = $("#horizontalNav").get(0).getBoundingClientRect();
-        if ((this.fluidbook.l10n.ltr && !this.fluidbook.datas.invertMenuPosition) || (this.fluidbook.l10n.rtl && this.fluidbook.datas.invertMenuPosition)) {
+        if ((this.fluidbook.l10n.ltr && !this.fluidbook.settings.invertMenuPosition) || (this.fluidbook.l10n.rtl && this.fluidbook.settings.invertMenuPosition)) {
             $("#afterSearch").css({left: rect.left + rect.width, right: 'auto'});
         } else {
             $("#afterSearch").css({right: this.ww - rect.right + rect.width, left: 'auto'});
index 5fec188b027c822b890aa12847e1be931ee37654..520758072935466d1cbd9a5f4bd7666ccf42e989 100644 (file)
@@ -1,7 +1,7 @@
 function FluidbookScorm(fluidbook) {
     this.fluidbook = fluidbook;
     this.linksToComplete = [];
-    this.manageScore = this.fluidbook.datas.scorm_score;
+    this.manageScore = this.fluidbook.settings.scorm_score;
     this.init();
 }
 
@@ -9,8 +9,8 @@ FluidbookScorm.prototype = {
     init: function () {
         var $this = this;
 
-        if (this.fluidbook.datas.scorm_variables.linkstocomplete) {
-            this.linksToComplete = this.fluidbook.datas.scorm_variables.linkstocomplete.split(',');
+        if (this.fluidbook.settings.scorm_variables.linkstocomplete) {
+            this.linksToComplete = this.fluidbook.settings.scorm_variables.linkstocomplete.split(',');
         }
 
         $(document).on('click', 'a', function () {
@@ -26,13 +26,13 @@ FluidbookScorm.prototype = {
             $this.hideScormLinks();
         });
 
-        if (this.fluidbook.datas.scorm_enable && window.initScorm !== undefined) {
+        if (this.fluidbook.settings.scorm_enable && window.initScorm !== undefined) {
             initScorm();
         }
 
         // Mark complete when the user reaches the last page
         $(this.fluidbook).on('fluidbook.page.change.end', function () {
-            if ($this.fluidbook.currentPage == $this.fluidbook.datas.pages && $this.fluidbook.datas.scorm_complete_on_last_page) {
+            if ($this.fluidbook.currentPage == $this.fluidbook.settings.pages && $this.fluidbook.settings.scorm_complete_on_last_page) {
                 scormMarkAsComplete();
             }
         });
@@ -58,7 +58,7 @@ FluidbookScorm.prototype = {
     },
 
     isActive: function () {
-        if (!this.fluidbook.datas.scorm_enable) {
+        if (!this.fluidbook.settings.scorm_enable) {
             return false;
         }
         if (undefined !== window.FORCE_SCORM
index e93a4c7a1d4584cafc81a41ae50e98e00744fe35..672be94bd252229231dfe0e90988700c7263dc58 100644 (file)
@@ -3,7 +3,7 @@ function FluidbookSearch(fluidbook) {
     this.indexLoaded = false;
     this.termsToHighlight = [];
     this.highlights = [];
-    this.highlightEnabled = fluidbook.datas.highlightResults;
+    this.highlightEnabled = fluidbook.settings.highlightResults;
     this.resultPages = [];
     this.resultNavPages = [];
     this.plugins = [];
@@ -226,7 +226,7 @@ FluidbookSearch.prototype = {
     },
 
     _loadTexts: function (callback) {
-        if (this.fluidbook.datas.searchWordSelectionAlgorithm === 'expression') {
+        if (this.fluidbook.settings.searchWordSelectionAlgorithm === 'expression') {
             loadJSLibrary('data/search.texts.js', function () {
                 callback();
             });
@@ -262,7 +262,7 @@ FluidbookSearch.prototype = {
     },
 
     getSearchWordSelectionAlgorithm: function (q) {
-        var a = this.fluidbook.datas.searchWordSelectionAlgorithm;
+        var a = this.fluidbook.settings.searchWordSelectionAlgorithm;
         if (q.indexOf(' ') === -1 && a === 'expression') {
             a = 'begins';
         }
@@ -288,7 +288,7 @@ FluidbookSearch.prototype = {
             term = searchTerms[searchTerm];
             terms.push(term);
             for (indexWord in INDEX) {
-                if (indexWord.length < this.fluidbook.datas.ignoreWordLimit) {
+                if (indexWord.length < this.fluidbook.settings.ignoreWordLimit) {
                     continue;
                 }
 
@@ -330,7 +330,7 @@ FluidbookSearch.prototype = {
         total = 0;
         for (var dpNumber in doublePages) {
             var doublePageOccurences = doublePages[dpNumber];
-            if (Object.keys(doublePageOccurences).length === nbwords || this.fluidbook.datas.searchPageSelectionAlgorithm === 'OR') {
+            if (Object.keys(doublePageOccurences).length === nbwords || this.fluidbook.settings.searchPageSelectionAlgorithm === 'OR') {
                 var totalOccurrences = 0;
                 for (var ww in doublePageOccurences) {
                     totalOccurrences += doublePageOccurences[ww];
@@ -458,7 +458,7 @@ FluidbookSearch.prototype = {
         for (var t in terms) {
             var term = terms[t];
             for (var w in HIGHLIGHTS) {
-                if (algo !== 'expression' && w.length < this.fluidbook.datas.ignoreWordLimit) {
+                if (algo !== 'expression' && w.length < this.fluidbook.settings.ignoreWordLimit) {
                     continue;
                 }
 
@@ -502,7 +502,7 @@ FluidbookSearch.prototype = {
         }
 
         // Test if we highlight results
-        if (!this.fluidbook.datas.highlightAllOccurences) {
+        if (!this.fluidbook.settings.highlightAllOccurences) {
             var evenPageNumber = pageNr;
 
             if (!this.singleMode && evenPageNumber % 2 === 1) {
@@ -541,7 +541,7 @@ FluidbookSearch.prototype = {
                 if (pageIndex == -1) {
                     continue;
                 }
-                this.highlightOccurence(o, h.word, h.term, h.color, pageIndex * this.fluidbook.datas.width);
+                this.highlightOccurence(o, h.word, h.term, h.color, pageIndex * this.fluidbook.settings.width);
             }
         }
     },
@@ -568,7 +568,7 @@ FluidbookSearch.prototype = {
         }
 
         var padding = position.height * 0.2;
-        var z = this.fluidbook.datas.cssScale;
+        var z = this.fluidbook.settings.cssScale;
         var h = $('<div class="highlight" data-color="' + color + '"></div>');
         var coords = {
             top: (position.y - position.height - padding * 2) * z,
@@ -658,7 +658,7 @@ FluidbookSearch.prototype = {
 
     // Check if a search is active in the interface
     isSearchActive: function () {
-        if (!this.fluidbook.datas.search) {
+        if (!this.fluidbook.settings.search) {
             return false; // Search feature disabled on this Fluidbook
         }
 
@@ -770,7 +770,7 @@ FluidbookSearch.prototype = {
 
             if (totalHits === 0) {
                 // Should pages with no results still be shown?
-                if ($this.fluidbook.datas.searchShowNoResultsPages) {
+                if ($this.fluidbook.settings.searchShowNoResultsPages) {
                     $(this).append('<div class="overlay"></div>');
                     $(this).append('<div class="hits no">' + $this.fluidbook.l10n.__('no result found') + '</div>');
                 } else {
index 4a7f08b03a01879b9f74fa25341a7202b2b39037..60a0245f96b489779c74d7fc3ec5977d95dbe848 100644 (file)
@@ -5,23 +5,23 @@ function FluidbookService(fluidbook, id) {
 }
 
 FluidbookService.prototype = {
-    call: function (func, datas, handler, context) {
-        datas['id'] = this.id;
+    call: function (func, settings, handler, context) {
+        settings['id'] = this.id;
         return $.ajax({
             url: this.baseURL + func,
             context: context,
             format: 'xml',
             crossDomain: true,
-            data: datas,
+            data: settings,
             success: function (data) {
                 handler.call(this, data)
             }
         });
     },
-    open: function (func, datas, options) {
-        datas['id'] = this.id;
+    open: function (func, settings, options) {
+        settings['id'] = this.id;
         var u = [];
-        $.each(datas, function (k, v) {
+        $.each(settings, function (k, v) {
             u.push(k + '=' + encodeURIComponent(v));
         });
         var url = this.baseURL + func + '?' + u.join('&');
index ef17b9da7087903524fe8351cc55a8b74ee90326..0f60d476e343185c38c18340dd568e2f5d76eb64 100644 (file)
@@ -2,7 +2,7 @@ function FluidbookShare(fluidbook) {
     this.fluidbook = fluidbook;
     if (this.isEnabled()) {
         var $this = this;
-        if (this.fluidbook.datas.phonegap !== 'android') {
+        if (this.fluidbook.settings.phonegap !== 'android') {
             $(document).on('click', '.share', function () {
                 var f = 'send' + ucfirst($(this).data('service'));
                 var url = $(this).data("url");
@@ -37,7 +37,7 @@ function FluidbookShare(fluidbook) {
             }
         });
 
-        if (this.fluidbook.datas.phonegap === 'android') {
+        if (this.fluidbook.settings.phonegap === 'android') {
             $(document).on('click', '#shareLinks, #shareLinks a', function (e) {
                 e.stopPropagation();
                 e.stopImmediatePropagation();
@@ -51,14 +51,14 @@ function FluidbookShare(fluidbook) {
 
 FluidbookShare.prototype = {
     isEnabled: function () {
-        return this.fluidbook.datas.share && this.getShareURL('') !== false;
+        return this.fluidbook.settings.share && this.getShareURL('') !== false;
     },
 
     getFluidbookURL: function (withPage) {
         var l = window.location.toString();
-        if (this.fluidbook.datas.restrictPrintDownload !== "") {
-            l = l.replace('?' + this.fluidbook.datas.restrictPrintDownload, '');
-            l = l.replace(this.fluidbook.datas.restrictPrintDownload, '');
+        if (this.fluidbook.settings.restrictPrintDownload !== "") {
+            l = l.replace('?' + this.fluidbook.settings.restrictPrintDownload, '');
+            l = l.replace(this.fluidbook.settings.restrictPrintDownload, '');
         }
         var e = l.split("#");
 
@@ -75,9 +75,9 @@ FluidbookShare.prototype = {
         }
         if (url == '') {
             var res = false;
-            if (this.fluidbook.support.offline || this.fluidbook.datas.phonegap) {
-                if (this.fluidbook.datas.offlineLink !== '' && this.fluidbook.datas.offlineLink !== 'http://') {
-                    res = this.fluidbook.datas.offlineLink;
+            if (this.fluidbook.support.offline || this.fluidbook.settings.phonegap) {
+                if (this.fluidbook.settings.offlineLink !== '' && this.fluidbook.settings.offlineLink !== 'http://') {
+                    res = this.fluidbook.settings.offlineLink;
                 }
             } else {
                 res = this.getFluidbookURL();
@@ -99,24 +99,24 @@ FluidbookShare.prototype = {
 
     getShareTitle: function (url) {
         if (url == '') {
-            return this.fluidbook.datas.title;
+            return this.fluidbook.settings.title;
         } else {
             var e = url.split(':');
             if (e[0] == 'article') {
                 return this.getSEOArticle(e[1]).title;
             }
         }
-        return this.fluidbook.datas.title;
+        return this.fluidbook.settings.title;
     },
 
     getEmailSubject: function (url, context) {
         if (context === 'publication') {
-            if (this.fluidbook.datas.email_title === '') {
-                return this.fluidbook.datas.title;
+            if (this.fluidbook.settings.email_title === '') {
+                return this.fluidbook.settings.title;
             }
-            return this.fluidbook.datas.email_title;
+            return this.fluidbook.settings.email_title;
         } else if (context === 'product') {
-            return this.fluidbook.datas.product_email_title;
+            return this.fluidbook.settings.product_email_title;
         } else if (context === 'article') {
             return this.getSEOArticle(url).title;
         }
@@ -125,15 +125,15 @@ FluidbookShare.prototype = {
     getEmailBody: function (url, context) {
         var body;
         var u = this.getShareURL(url);
-        var title = this.fluidbook.datas.title;
+        var title = this.fluidbook.settings.title;
         if (context === 'publication') {
-            if (this.fluidbook.datas.email_body === '') {
+            if (this.fluidbook.settings.email_body === '') {
                 body = this.fluidbook.l10n.__('Veuillez cliquer sur le lien suivant pour ouvrir %title%\\n%link%');
             } else {
-                body = this.fluidbook.datas.email_body;
+                body = this.fluidbook.settings.email_body;
             }
         } else if (context === 'product') {
-            body = this.fluidbook.datas.product_email_body;
+            body = this.fluidbook.settings.product_email_body;
         } else if (context === 'article') {
             body = '%title%\\n%link%';
             title = this.getSEOArticle(url).title;
@@ -157,7 +157,7 @@ FluidbookShare.prototype = {
         if (title.indexOf('article:') === 0) {
             title = title.substr(8);
         }
-        return this.fluidbook.datas.seoArticles[title];
+        return this.fluidbook.settings.seoArticles[title];
     },
 
     getShareLinks: function (hideLabels, url, context) {
@@ -170,28 +170,28 @@ FluidbookShare.prototype = {
 
         hideLabels = hideLabels || false;
 
-        if (this.fluidbook.datas.friend) {
+        if (this.fluidbook.settings.friend) {
             shareLinks['email'] = 'E-mail';
         }
-        if (this.fluidbook.datas.facebook) {
+        if (this.fluidbook.settings.facebook) {
             shareLinks['facebook'] = 'Facebook';
         }
-        if (this.fluidbook.datas.twitter) {
+        if (this.fluidbook.settings.twitter) {
             shareLinks['twitter'] = 'Twitter';
         }
-        if (this.fluidbook.datas.whatsapp) {
+        if (this.fluidbook.settings.whatsapp) {
             shareLinks['whatsapp'] = 'WhatsApp';
         }
-        if (this.fluidbook.datas.googleplus) {
+        if (this.fluidbook.settings.googleplus) {
             shareLinks['googleplus'] = 'Google Plus';
         }
-        if (this.fluidbook.datas.linkedin) {
+        if (this.fluidbook.settings.linkedin) {
             shareLinks['linkedin'] = 'LinkedIn';
         }
-        if (this.fluidbook.datas.viadeo) {
+        if (this.fluidbook.settings.viadeo) {
             shareLinks['viadeo'] = 'Viadeo';
         }
-        if (this.fluidbook.datas.pinterest) {
+        if (this.fluidbook.settings.pinterest) {
             shareLinks['pinterest'] = 'Pinterest';
         }
 
@@ -234,10 +234,10 @@ FluidbookShare.prototype = {
     },
     intentShare: function (subject, body) {
         if (subject == undefined) {
-            subject = this.fluidbook.datas.title;
+            subject = this.fluidbook.settings.title;
         }
         if (body == undefined) {
-            body = this.fluidbook.datas.title + ' : ' + this.getShareURL();
+            body = this.fluidbook.settings.title + ' : ' + this.getShareURL();
         }
 
         // Normalize new lines
@@ -245,7 +245,7 @@ FluidbookShare.prototype = {
         body = body.replace(/\r/g, "\n");
         body = body.replace(/\n/g, "\r\n");
 
-        if (this.fluidbook.datas.phonegap === 'android') {
+        if (this.fluidbook.settings.phonegap === 'android') {
             var extras = {};
             extras[window.plugins.webintent.EXTRA_SUBJECT] = subject;
             extras[window.plugins.webintent.EXTRA_TEXT] = body;
@@ -265,9 +265,9 @@ FluidbookShare.prototype = {
     getTweetContent: function (url, context) {
         var tweet;
         if (context === 'publication') {
-            tweet = this.fluidbook.datas.twitter_description;
+            tweet = this.fluidbook.settings.twitter_description;
         } else if (context === 'product') {
-            tweet = this.fluidbook.datas.product_tweet;
+            tweet = this.fluidbook.settings.product_tweet;
         } else if (context === 'article') {
             tweet = '%title% : %short%';
         }
@@ -334,7 +334,7 @@ FluidbookShare.prototype = {
         this.fluidbook.stats.track(12);
     },
     sendPinterest: function (url, context) {
-        this.fluidbook.wopen('http://pinterest.com/pin/create/button/?url=' + encodeURIComponent(this.getShareURL(url)) + '&media=' + encodeURIComponent('https://workshop.fluidbook.com/services/facebook_thumbnail?id=' + this.fluidbook.datas.id + '&j=' + Date.now()) + '"', 'width=650,height=400');
+        this.fluidbook.wopen('http://pinterest.com/pin/create/button/?url=' + encodeURIComponent(this.getShareURL(url)) + '&media=' + encodeURIComponent('https://workshop.fluidbook.com/services/facebook_thumbnail?id=' + this.fluidbook.settings.id + '&j=' + Date.now()) + '"', 'width=650,height=400');
         this.fluidbook.stats.track(12);
     }
 };
\ No newline at end of file
index f2a47e153566559fc9659fa7dd664f601bfdee2f..47ab87d5e0b54dd61082ec2a79267c7c81fff56c 100644 (file)
@@ -1,14 +1,14 @@
 function FluidbookSound(fluidbook) {
     this.fluidbook = fluidbook;
 
-    if (this.fluidbook.datas.soundTheme === '' || !Modernizr.audio || this.fluidbook.support.iOS || this.fluidbook.support.android) {
+    if (this.fluidbook.settings.soundTheme === '' || !Modernizr.audio || this.fluidbook.support.iOS || this.fluidbook.support.android) {
         this.enabled = false;
         this.on = false;
         return;
     }
 
     this.enabled = true;
-    this.on = !!this.fluidbook.datas.soundOn;
+    this.on = !!this.fluidbook.settings.soundOn;
     this.audios = {};
     this.playing = null;
 
index 5d32986d1ca884c60da7383fbeba69dc9a207ff0..b729848ae72a7f9ea7b21f1128361e974237986a 100644 (file)
@@ -1,13 +1,13 @@
 function FluidbookStats(fluidbook) {\r
     this.fluidbook = fluidbook;\r
-    this.id = this.fluidbook.datas.id;\r
+    this.id = this.fluidbook.settings.id;\r
     this.vid = guid();\r
-    if (this.fluidbook.datas.stats) {\r
+    if (this.fluidbook.settings.stats) {\r
         this.worker = new Worker('js/libs/fluidbook/workers/stats.js');\r
     }\r
-    if (this.fluidbook.datas.googleAnalytics !== '') {\r
+    if (this.fluidbook.settings.googleAnalytics !== '') {\r
         this.ga = 'gtag';\r
-        this.gaCodes = this.fluidbook.datas.googleAnalytics.split(',');\r
+        this.gaCodes = this.fluidbook.settings.googleAnalytics.split(',');\r
         $.each(this.gaCodes, function (k, code) {\r
             gtag('config', code, {'send_page_view': false});\r
         });\r
@@ -36,7 +36,7 @@ FluidbookStats.prototype = {
             return;\r
         }\r
 \r
-        if (this.fluidbook.datas.stats) {\r
+        if (this.fluidbook.settings.stats) {\r
             this.trackFluidbook(type, page, extra);\r
         }\r
         this.trackGoogleAnalytics(type, page, extra);\r
index 150777a247029b84376dd7c608aa3928d76becd4..0befbfc9bfeeb3cd54bcc26354bff97a109c682b 100644 (file)
@@ -14,7 +14,7 @@ function FluidbookSupport(fluidbook) {
     // If in node-webkit or if the index.html fluidbook is locally open in a browser
     this.offline = (typeof process !== "undefined" && process.versions['node-webkit']) || window.location.toString().indexOf("file://") == 0;
 
-    switch (this.fluidbook.datas.mobileVersion) {
+    switch (this.fluidbook.settings.mobileVersion) {
         case 'html5':
             this.imagesVersion = false;
             break;
@@ -43,7 +43,7 @@ function FluidbookSupport(fluidbook) {
         if (Modernizr.mq('(min-device-width : 320px) and (max-device-width : 480px)')) {
             this.resolution = 150;
         } else {
-            this.resolution = Modernizr.mq('(-webkit-min-device-pixel-ratio: 2)') ? this.fluidbook.datas.retinaResolution : 150;
+            this.resolution = Modernizr.mq('(-webkit-min-device-pixel-ratio: 2)') ? this.fluidbook.settings.retinaResolution : 150;
         }
     } else {
         this.resolution = window.resolution;
@@ -51,7 +51,7 @@ function FluidbookSupport(fluidbook) {
     //console.log('Images resolution :: ' + this.resolution);
 
     this.isMobile = isMobile();
-    this.SVG = Modernizr.svg && this.fluidbook.datas.mobileIconVector;
+    this.SVG = Modernizr.svg && this.fluidbook.settings.mobileIconVector;
 
     this.nwjs = (typeof process !== "undefined" && process.versions['node-webkit']);
 
@@ -159,9 +159,9 @@ FluidbookSupport.prototype = {
         try {
             if ((this.fluidbook.pad && this.fluidbook.pad.enabled) || this.fluidbook.mobilefirst.enabled) {
                 return 0;
-            } else if (this.fluidbook.datas.mobileNavigationType === 'landscape') {
+            } else if (this.fluidbook.settings.mobileNavigationType === 'landscape') {
                 return 90;
-            } else if (this.fluidbook.datas.mobileNavigationType === 'portrait') {
+            } else if (this.fluidbook.settings.mobileNavigationType === 'portrait') {
                 return 0;
             }
         } catch (err) {
index 3bb2441723ebbd408c8fd5bd7d04a7301a3b4a7b..b9aa169ce4f80bda732cd7b6e71dc5fddc09532e 100644 (file)
@@ -2,7 +2,7 @@ function FluidbookTabs(fluidbook) {
     this.fluidbook = fluidbook;
     this.hasSVGTabs = false;
     this.visibility = {};
-    if (this.fluidbook.datas.svgTabs) {
+    if (this.fluidbook.settings.svgTabs) {
         this.hasSVGTabs = true;
         this.svgLoaded = false;
         this.cont;
@@ -15,7 +15,7 @@ function FluidbookTabs(fluidbook) {
 
 FluidbookTabs.prototype = {
     hasTabs: function () {
-        return this.fluidbook.datas.tabsHTML5 !== '';
+        return this.fluidbook.settings.tabsHTML5 !== '';
     },
 
     initZip: function () {
@@ -35,7 +35,7 @@ FluidbookTabs.prototype = {
     },
 
     guessTabsWidth: function (bookScale) {
-        var fh = this.fluidbook.datas.height * bookScale;
+        var fh = this.fluidbook.settings.height * bookScale;
         var tabsScale = fh / this.naturalDimensions.height;
 
         return this.linkWidth * tabsScale;
@@ -74,24 +74,24 @@ FluidbookTabs.prototype = {
         $("#background .links").append('<div id="l_tabs" class="link tabslink multimedia ' + this.align + '" data-id="tabs"></div>');
         this.element = $("#l_tabs");
 
-        this.addLinks(this.fluidbook.datas.tabsPages);
+        this.addLinks(this.fluidbook.settings.tabsPages);
         this.initTabs();
     },
 
     setOptions: function () {
-        this.hideOnLastPage = this.fluidbook.datas.tabsHideOnLastPage;
-        this.hideOnFirstPage = this.fluidbook.datas.tabsHideOnCover;
-        this.hideOnPortrait = this.fluidbook.datas.tabsHideOnPortrait;
-        this.hideOnZoom = this.fluidbook.datas.tabsHideOnZoom;
-        this.hideWhenOverlapingArrows = this.fluidbook.datas.tabsHideWhenOverlapingArrows;
+        this.hideOnLastPage = this.fluidbook.settings.tabsHideOnLastPage;
+        this.hideOnFirstPage = this.fluidbook.settings.tabsHideOnCover;
+        this.hideOnPortrait = this.fluidbook.settings.tabsHideOnPortrait;
+        this.hideOnZoom = this.fluidbook.settings.tabsHideOnZoom;
+        this.hideWhenOverlapingArrows = this.fluidbook.settings.tabsHideWhenOverlapingArrows;
         this.mode = 'side';
-        this.side = this.align = this.fluidbook.datas.tabsSide;
-        this.margin = parseFloat(this.fluidbook.datas.tabsMargin);
-        this.hideEdge = this.fluidbook.datas.tabsHideEdges;
-        this.linkWidth = parseFloat(this.fluidbook.datas.tabsLinkWidth);
-        this.priority = parseFloat(this.fluidbook.datas.tabsPriority) / 100;
+        this.side = this.align = this.fluidbook.settings.tabsSide;
+        this.margin = parseFloat(this.fluidbook.settings.tabsMargin);
+        this.hideEdge = this.fluidbook.settings.tabsHideEdges;
+        this.linkWidth = parseFloat(this.fluidbook.settings.tabsLinkWidth);
+        this.priority = parseFloat(this.fluidbook.settings.tabsPriority) / 100;
 
-        this.sections = this.fluidbook.datas.tabsSections.map(function (x) {
+        this.sections = this.fluidbook.settings.tabsSections.map(function (x) {
             return parseInt(x);
         });
 
@@ -309,7 +309,7 @@ FluidbookTabs.prototype = {
                     }
                 }
                 if ($this.hideOnLastPage) {
-                    var last = $this.fluidbook.datas.pages;
+                    var last = $this.fluidbook.settings.pages;
                     if (last % 2 === 1) {
                         last--;
                     }
@@ -327,7 +327,7 @@ FluidbookTabs.prototype = {
                     }
                 }
                 if ($this.hideOnLastPage) {
-                    var last = $this.fluidbook.datas.pages;
+                    var last = $this.fluidbook.settings.pages;
                     if (last % 2 === 1) {
                         last--;
                     }
index 20b4b831c5b6c6a92d6c30f437e6a91ceb5e9209..7c6a38991cf862697e0bd1fb610af1e24201b660 100644 (file)
@@ -91,7 +91,7 @@ FluidbookTouch.prototype = {
                     } else {
                         $this.setZoomOriginFromEvent(event.srcEvent);
                         $this.fluidbook.zoom.setTransition(true);
-                        $this.fluidbook.zoom.setZoom($this.fluidbook.datas.zoom / 100, 1)
+                        $this.fluidbook.zoom.setZoom($this.fluidbook.settings.zoom / 100, 1)
                     }
                 }
                 event.preventDefault();
index 39f0de8ab1a5ad36ea5fbdefc8c102b1a60a52ff..092602b42116853c2b890abaceb60148c90c5d02 100644 (file)
@@ -46,7 +46,7 @@ function FluidbookVideo(fluidbook) {
     var not = [];
 
     if (this.video) {
-        var formats = this.fluidbook.datas.videoFormats;
+        var formats = this.fluidbook.settings.videoFormats;
         for (var i = 0; i < formats.length; i++) {
             var f = formats[i];
             if (f == 'mp4') {
@@ -113,11 +113,11 @@ FluidbookVideo.prototype = {
         }
 
 
-        if (fluidbook.datas.mobileVideosPath == '') {
+        if (fluidbook.settings.mobileVideosPath == '') {
             path = "data/links/" + name;
         } else {
-            path = fluidbook.datas.mobileVideosPath + name;
-            if (!fluidbook.datas.standalone && path.substr(0, 3) == '../') {
+            path = fluidbook.settings.mobileVideosPath + name;
+            if (!fluidbook.settings.standalone && path.substr(0, 3) == '../') {
                 path = '../' + path;
             }
         }
@@ -288,11 +288,11 @@ FluidbookVideo.prototype = {
 
         //console.info(width, height, name, loop);
 
-        if (fluidbook.datas.mobileVideosPath == '') {
+        if (fluidbook.settings.mobileVideosPath == '') {
             path = "data/links/" + name;
         } else {
-            path = fluidbook.datas.mobileVideosPath + name;
-            if (!fluidbook.datas.standalone && path.substr(0, 3) == '../') {
+            path = fluidbook.settings.mobileVideosPath + name;
+            if (!fluidbook.settings.standalone && path.substr(0, 3) == '../') {
                 path = '../' + path;
             }
         }
index 99782bcc0cf9edb3845af27c4dbe6a787e450142..dac6e375610848a7d1f37e29cb7d2ccf7cf6a2a3 100644 (file)
@@ -3,7 +3,7 @@ function FluidbookZoom(fluidbook) {
     this.zoom = 0;
     this.originpct = ['0%', '0%'];
     this.originpx = ['0px', '0px'];
-    this.max = this.fluidbook.datas.zoomw / 100;
+    this.max = this.fluidbook.settings.zoomw / 100;
     this.transition = true;
     this.enabled = true;
     this.shadowTimeout;
index f3784eb183479b2a31120c295ae8e69e9ba53715..52c2d9eaf874de5e33429a31669bce0a55344e7d 100644 (file)
@@ -132,7 +132,7 @@ FluidbookAveryForm.prototype = {
         $("#view").append('<div class="mview" data-form="avery" data-menu="form" data-maxwidth="650">' + view + '</div>');
 
         var options = ['<option value=""> -- ' + this.locale.choose_country + ' -- </option>'];
-        $.each(this.fluidbook.datas.countries, function (code, name) {
+        $.each(this.fluidbook.settings.countries, function (code, name) {
             options.push('<option value="' + code + '">' + name + '</option>');
         });
         $(".mview select[name='country']").html(options.join(''));
index cb54fab524ffc8ef8eaae0b8fac12f8c773d3017..f650bf5dfbf717a85facab18f79dbbb7cfcc4f6b 100644 (file)
@@ -26,7 +26,7 @@ FluidbookBulleForm.prototype = {
                }
                res += "</p>";
                res += '<form action="" method="post">';
-               res += '<input type="hidden" name="catalogue" value="' + this.fluidbook.datas.title + '" />';
+               res += '<input type="hidden" name="catalogue" value="' + this.fluidbook.settings.title + '" />';
                res += '<div><input type="text" name="nom" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your name') + '" /></div>';
                res += '<div><input type="text" name="prenom" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your first name') + '" /></div>';
                res += '<div><input type="email" name="email" value="" required="required" placeholder="' + this.fluidbook.l10n.__('your e-mail') + '" /></div>';
index be8deec05da763ebc770cd2cd36f89771df05f93..e9169228299f032f78279ba4d6a610d1b072ee0e 100644 (file)
@@ -148,28 +148,28 @@ FluidbookLinksZoom.prototype = {
                 var menu = '<div id="zoomPopupMenuWrapper"><div id="zoomPopupMenu">';
                 if (zoomLink.data('shareurl') !== undefined && zoomLink.data('shareurl') !== '') {
                     var shareURL;
-                    if (this.fluidbook.datas.product_share_link === 'product') {
+                    if (this.fluidbook.settings.product_share_link === 'product') {
                         shareURL = zoomLink.data('shareurl');
-                    } else if (this.fluidbook.datas.product_share_link === 'page') {
+                    } else if (this.fluidbook.settings.product_share_link === 'page') {
                         shareURL = this.fluidbook.share.getFluidbookURL(true);
                     }
                     menu += '<a href="#" class="button nolabel" data-tooltip="' + this.fluidbook.l10n.__('share') + '" data-action="share" data-extra="' + shareURL + '" data-context="product">' + getSpriteIcon('nav-share') + '</a>';
                 }
                 if (zoomLink.data('extra-1') !== undefined) {
-                    var label = this.fluidbook.datas.product_zoom_label_2;
-                    var icon = getSpriteIcon(this.fluidbook.datas.product_zoom_icon_2) !== 'none' ? getSpriteIcon(this.fluidbook.datas.product_zoom_icon_2) : '';
+                    var label = this.fluidbook.settings.product_zoom_label_2;
+                    var icon = getSpriteIcon(this.fluidbook.settings.product_zoom_icon_2) !== 'none' ? getSpriteIcon(this.fluidbook.settings.product_zoom_icon_2) : '';
                     var linkClass = "";
                     if (label !== '') {
                         label = '<span>' + label + '</span>';
                     } else {
                         linkClass = " nolabel";
                     }
-                    menu += '<a href="' + zoomLink.data('extra-1') + '"  data-tooltip="' + this.fluidbook.datas.product_zoom_tooltip_2 + '" target="_blank" class="button ' + linkClass + '">' + icon + label + '</a>';
+                    menu += '<a href="' + zoomLink.data('extra-1') + '"  data-tooltip="' + this.fluidbook.settings.product_zoom_tooltip_2 + '" target="_blank" class="button ' + linkClass + '">' + icon + label + '</a>';
                 }
                 if (zoomLink.data('producturl') !== undefined && zoomLink.data('producturl') !== '') {
-                    var label = this.fluidbook.datas.product_zoom_label_1 !== '' ? this.fluidbook.datas.product_zoom_label_1 : this.fluidbook.l10n.__('see on the website');
-                    var icon = getSpriteIcon(this.fluidbook.datas.product_zoom_icon_1) !== 'none' ? getSpriteIcon(this.fluidbook.datas.product_zoom_icon_1) : '';
-                    menu += '<a href="' + zoomLink.data('producturl') + '"  data-tooltip="' + this.fluidbook.datas.product_zoom_tooltip_1 + '" target="_blank" class="button">' + icon + '<span>' + label + '</span></a>';
+                    var label = this.fluidbook.settings.product_zoom_label_1 !== '' ? this.fluidbook.settings.product_zoom_label_1 : this.fluidbook.l10n.__('see on the website');
+                    var icon = getSpriteIcon(this.fluidbook.settings.product_zoom_icon_1) !== 'none' ? getSpriteIcon(this.fluidbook.settings.product_zoom_icon_1) : '';
+                    menu += '<a href="' + zoomLink.data('producturl') + '"  data-tooltip="' + this.fluidbook.settings.product_zoom_tooltip_1 + '" target="_blank" class="button">' + icon + '<span>' + label + '</span></a>';
                 }
                 menu += '</div></div>';
                 $groupWrapper.append('<div id="zoomPopupBackground"><div class="bg"></div>' + menu + '</div>');
index a3e7313595d8de2f8ebb123a65af2530d2d39327..8039c43241a02916b12cc4b27e0922ba8e53e3a7 100644 (file)
@@ -2,10 +2,10 @@ function FluidbookChapters(fluidbook, chapters) {
     this.fluidbook = fluidbook;
     this.chapters = chapters;
     this.style = 'classic';
-    this.cascade = this.fluidbook.datas.chaptersCascade;
+    this.cascade = this.fluidbook.settings.chaptersCascade;
     this.cascadeEventsInited = false;
-    if (this.fluidbook.datas.mobileChaptersStyle) {
-        this.style = this.fluidbook.datas.mobileChaptersStyle;
+    if (this.fluidbook.settings.mobileChaptersStyle) {
+        this.style = this.fluidbook.settings.mobileChaptersStyle;
     }
     this.html = [];
     this.titles = {'null': this.fluidbook.l10n.__('chapters')};
@@ -85,7 +85,7 @@ FluidbookChapters.prototype = {
 
         // Columns setup
         var nbItems = 0;
-        var columns = parseInt(this.fluidbook.datas.chaptersColumns);
+        var columns = parseInt(this.fluidbook.settings.chaptersColumns);
         $.each(this.chapters, function (k, v) {
             if (v.label === '--' || v.label === '++') {
 
@@ -203,7 +203,7 @@ FluidbookChapters.prototype = {
         var p = '';
         var pdisplay = '';
         if (chapter.page != '') {
-            if (this.fluidbook.datas.chaptersPagesNumber === 'virtual') {
+            if (this.fluidbook.settings.chaptersPagesNumber === 'virtual') {
                 p = this.fluidbook.virtualToPhysical(chapter.page);
                 pdisplay = chapter.page;
             } else {
index 112e70a90f4b28242ac7ff6769c73e749c2a2b39..a6b7163c2a128d7609a434467684b01010eaae07 100644 (file)
@@ -80,8 +80,8 @@ FluidbookIndex.prototype = {
         var res = '';
         res += '<div class="' + contentClass + '"><div class="indexView">';
 
-        if (this.fluidbook.datas.indexMessage !== '') {
-            res += '<div class="indexViewMessage">' + this.fluidbook.datas.indexMessage + '</div>';
+        if (this.fluidbook.settings.indexMessage !== '') {
+            res += '<div class="indexViewMessage">' + this.fluidbook.settings.indexMessage + '</div>';
         }
 
         res += '<div class="indexViewHolder">';
@@ -120,7 +120,7 @@ FluidbookIndex.prototype = {
             if (i > 0) {
                 ix1 += '<div class="thumb ' + s1 + '"' + dim.thumb + '><a href="#/page/' + i + '">' + this.fluidbook.loader.getThumbImage(i, true, dim.thumb) + '</a><span class="number"' + dim.pagenumber + '>' + this.fluidbook.physicalToVirtual(i) + '</span>';
                 if (this.fluidbook.bookmarks.enabled) {
-                    ix1 += this.fluidbook.bookmarks.getBookmarkForPage(i, mobileFirst, this.fluidbook.datas.bookmarkPermanentIcon);
+                    ix1 += this.fluidbook.bookmarks.getBookmarkForPage(i, mobileFirst, this.fluidbook.settings.bookmarkPermanentIcon);
                 }
                 pages.push(i);
                 ix1 += '</div>';
index 1c18768954057ae7aa62d65c3d63f88dff527d21..ffa490f24fedc04cf177607c6ae2ff2cc3b73602 100644 (file)
@@ -38,14 +38,14 @@ FluidbookMobileFirstSlider.prototype = {
     },
 
     changePage: function (page) {
-        var dim = this.fluidbook.datas.pagesDimensions[page];
+        var dim = this.fluidbook.settings.pagesDimensions[page];
         var ratio = dim[0] / dim[1];
         var h = this.width / ratio;
 
         var $this = this;
 
-        this.element.find('.pagenumber').text(page + '/' + this.fluidbook.datas.pages);
-        this.element.find('.progress').css('width', (100 * (page / this.fluidbook.datas.pages)) + "%")
+        this.element.find('.pagenumber').text(page + '/' + this.fluidbook.settings.pages);
+        this.element.find('.progress').css('width', (100 * (page / this.fluidbook.settings.pages)) + "%")
 
         this.fluidbook.loader.loadThumb(page, function () {
             var img = $this.fluidbook.loader.loadThumb(page, function () {
index 553d28bae44950f510f892ac6047c512fedce3cb..f9cf9e17eb6f6ae7ed221f92dbc9fd80b49a76ae 100644 (file)
@@ -44,7 +44,7 @@ var AtlanticDL = {
         AtlanticDL.languages = [];
         AtlanticDL.currentProduct = product;
 
-        $.each(DATAS.basketReferences.Feuil1, function (k, v) {
+        $.each(fluidbook.settings.basketReferences.Feuil1, function (k, v) {
             if (product === $.trim(String(v[0])).toLowerCase()) {
                 AtlanticDL.data.push({
                     'product': v[0],
index 3267802f98b8b08659e4f669d9ce1a1e057042c2..698d2237def2eada5843c4cd0a6606584fc73c26 100644 (file)
@@ -16,7 +16,7 @@ function initWescoNav() {
 
     console.log('initWescoNav');
     var select = $('<select id="wescosalesselect"></select>');
-    $.each(DATAS.basketReferences, function (k, v) {
+    $.each(fluidbook.settings.basketReferences, function (k, v) {
         select.append('<option value="' + k + '">' + k + '</option>');
     });
     $("header nav").after('<div id="wescosalesselector"><span>VENTES</span> : </div>');
@@ -138,8 +138,8 @@ function setWescoSalesPanel(ref, e, updateOnly) {
 function getAllRefs() {
     if (allrefs === null) {
         var res = [];
-        for (var country in DATAS.basketReferences) {
-            var sheet = DATAS.basketReferences[country];
+        for (var country in fluidbook.settings.basketReferences) {
+            var sheet = fluidbook.settings.basketReferences[country];
             for (var linenum in sheet) {
                 var line = sheet[linenum];
                 if (line[0] === null) {
@@ -165,7 +165,7 @@ function getAllRefs() {
 function getPagesOfRefs() {
     if (pagesofrefs === null) {
         pagesofrefs = {};
-        $.each(fluidbook.datas.pagesOfCustomLinks, function (k, v) {
+        $.each(fluidbook.settings.pagesOfCustomLinks, function (k, v) {
             var possibleRefs = getPossibleReferences(k);
             $.each(possibleRefs, function (kk, ref) {
                 pagesofrefs[ref] = v;
@@ -276,8 +276,8 @@ function getWescoRef(ref) {
     ref = normalizeRef(ref);
     if (wsref[ref] === undefined) {
         var res = {countries: {}, del: ''};
-        for (var country in DATAS.basketReferences) {
-            var sheet = DATAS.basketReferences[country];
+        for (var country in fluidbook.settings.basketReferences) {
+            var sheet = fluidbook.settings.basketReferences[country];
             var line0 = sheet[0];
             var l = line0.length;
             for (var linenum in sheet) {
index 00bdf17c4cfe669ffcd994d12c5f96f555040dd0..47b1752cd1d8ceda6c7beb713d2d41e7a2d87ffd 100644 (file)
@@ -71,7 +71,7 @@ function initScormEvents() {
     SCORM_EVENTS_INITED = true;
 
     $(window).on('unload', function () {
-        if (fluidbook.datas.scorm_complete_on_exit) {
+        if (fluidbook.settings.scorm_complete_on_exit) {
             scormMarkAsComplete();
         }
         finishScorm();
@@ -188,12 +188,12 @@ function initScormInteractions() {
         return;
     }
     SCORM_INTERACTIONS_INITED = true;
-    if (fluidbook.datas.scorm_quizdata === '') {
+    if (fluidbook.settings.scorm_quizdata === '') {
         return;
     }
     var n = 0;
-    for (var sheet in fluidbook.datas.scorm_quizdata) {
-        var s = fluidbook.datas.scorm_quizdata[sheet];
+    for (var sheet in fluidbook.settings.scorm_quizdata) {
+        var s = fluidbook.settings.scorm_quizdata[sheet];
         for (var l in s) {
             if (l == 0) {
                 continue;
@@ -209,7 +209,7 @@ function initScormInteractions() {
     if (fluidbook.scorm.manageScore && SCORM_WEIGHTING > 0) {
         pipwerks.SCORM.set('cmi.score.min', '0');
         pipwerks.SCORM.set('cmi.score.max', SCORM_WEIGHTING);
-        SCORM_SUCCESS_SCORE = parseFloat(fluidbook.datas.scorm_score_min) / 100;
+        SCORM_SUCCESS_SCORE = parseFloat(fluidbook.settings.scorm_score_min) / 100;
 
         updateInteractionsScore();
     }
@@ -278,7 +278,7 @@ function answerScormInteraction(id, learner_response, result, set_latency) {
 
     if (fluidbook.scorm.manageScore) {
         if (result === undefined) {
-            result = fluidbook.datas.scorm_quiz_as_questionnaire || (learner_response === SCORM_QUESTIONS[n].correct_response);
+            result = fluidbook.settings.scorm_quiz_as_questionnaire || (learner_response === SCORM_QUESTIONS[n].correct_response);
         }
         setScormValue('cmi.interactions.' + n + '.result', result ? 'correct' : 'incorrect');
     }
index 9aa3a601d2c6f57d9e85c5f11ecfcef41674a535..7f317b88ba80ca8cb7e15aec8163c074e997244f 100644 (file)
@@ -36,7 +36,7 @@ try {
         $_GET = parseGet();
         INITED = false;
 
-        if (DATAS && DATAS.phonegap) {
+        if (SETTINGS && SETTINGS.phonegap) {
             loadPhonegap();
         } else {
             setTimeout(function () {
@@ -49,7 +49,7 @@ try {
         var cordovaPath = 'data/cordova.js';
         var cordovaStorage = window.localStorage.getItem('cordova');
         OFFLINEAPP = window.localStorage.getItem('offlineapp') == '1';
-        if (window.localStorage.getItem('offline.' + DATAS.id) == '1') {
+        if (window.localStorage.getItem('offline.' + SETTINGS.id) == '1') {
             FINISHLOADING = true;
         }
 
@@ -114,7 +114,7 @@ try {
         var manifest;
         var fsprefix = window.localStorage.getItem('galfsprefix');
 
-        PLATFORM = DATAS.phonegap;
+        PLATFORM = SETTINGS.phonegap;
 
         if (PLATFORM == 'ios') {
             try {
@@ -143,7 +143,7 @@ try {
 
         if (!OFFLINEAPP) {
             console.log('set manifest from manifest pub');
-            manifest = collection.manifestPub[DATAS.id];
+            manifest = collection.manifestPub[SETTINGS.id];
         }
 
 
@@ -176,7 +176,7 @@ try {
                 if (info.success) {
                     console.log('set offline flag');
                     FINISHLOADING = true;
-                    window.localStorage.setItem('offline.' + DATAS.id, '1');
+                    window.localStorage.setItem('offline.' + SETTINGS.id, '1');
                 }
             });
 
@@ -188,7 +188,7 @@ try {
                 if (info.bundleName == 'extras') {
                     console.log('set offline flag');
                     FINISHLOADING = true;
-                    window.localStorage.setItem('offline.' + DATAS.id, '1');
+                    window.localStorage.setItem('offline.' + SETTINGS.id, '1');
                 }
                 try {
                     if (fluidbook && fluidbook.loader) {
@@ -253,7 +253,7 @@ try {
         }
         INITED = true;
 
-        window.fluidbook = new Fluidbook(DATAS);
+        window.fluidbook = new Fluidbook(SETTINGS);
         if (null != gal) {
             fluidbook.gal = gal;
         }
@@ -275,7 +275,7 @@ try {
     function initEvents() {
         resize(true);
 
-        if (DATAS.preventRightClick) {
+        if (SETTINGS.preventRightClick) {
             $(document).on('contextmenu', function () {
                 return false;
             });
@@ -412,6 +412,9 @@ function resize(init) {
     if (init == undefined || init == null) {
         init = false;
     }
+    if (fluidbook.resize === undefined) {
+        return;
+    }
     fluidbook.resize.resize(init);
 }
 
@@ -517,7 +520,7 @@ function closePopin() {
 
 function getPublicationURL(id) {
     var url = window.home;
-    var replace = "/" + fluidbook.datas.id + "/";
+    var replace = "/" + fluidbook.settings.id + "/";
     var replaceby = "/" + id + "/";
     url = url.replace(replace, replaceby);
     return url;
index 1461c7a0d89d336f7b6f798b3f238148d18fa2ad..51ba17cb35934abc1f98bad1a18371879bc37214 100644 (file)
@@ -3,7 +3,7 @@ $(function () {
     _GET = parseGet({
         background: 'transparent',
         target: '_blank',
-        link: '../index.' + DATAS.htmlExtension,
+        link: '../index.' + SETTINGS.htmlExtension,
         time: 4
     });
     _GET['time'] = Math.max(1.5, _GET['time']);
@@ -14,7 +14,7 @@ $(function () {
         resize();
     });
 
-    var widget = $("#widget").fluidbookWidget(Math.max(0, DATAS.widgetStart), Math.min(DATAS.pages, DATAS.widgetEnd));
+    var widget = $("#widget").fluidbookWidget(Math.max(0, SETTINGS.widgetStart), Math.min(SETTINGS.pages, SETTINGS.widgetEnd));
     $(document).on('click', function () {
         window.open(_GET['link'], _GET['target'], 'width=' + screen.width + ',height=' + screen.height + ',status=0,toolbar=0,menubar=0,scrollbars=1');
     });
@@ -40,7 +40,7 @@ $(function () {
         if (this.from % 2 == 0) {
             this.to++;
         }
-        this.to = Math.min(DATAS.pages, this.to);
+        this.to = Math.min(SETTINGS.pages, this.to);
         this.currentPage = 0;
         this.dir = 1;