]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Oct 2014 13:34:49 +0000 (13:34 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Oct 2014 13:34:49 +0000 (13:34 +0000)
_index.html
js/libs/fluidbook/fluidbook.js

index c971828aee32c4b7ea7a0dc385e08cd313be59ca..a614a7c430cbd2b76129c55ef9514dcac65218c4 100644 (file)
@@ -5,7 +5,7 @@
                <meta charset="utf-8">
                <meta name="HandheldFriendly"  content="True">
                <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=IE8">
-               <meta name="apple-mobile-web-app-capable" content="yes">
+               <!--<meta name="apple-mobile-web-app-capable" content="yes">-->
                <meta name="viewport" content="initial-scale=1,minimum-scale=1">
                <meta name="google" content="notranslate">
                <!-- $description -->
index 2957b8dba6700a967d41b12f2f28f0b1a8ddca1f..7749a3a93964e2cd8cd7b912031ff796c3b35b52 100644 (file)
@@ -17,7 +17,7 @@ Fluidbook.MIDDLE = 7;
 Fluidbook.TOP = 8;
 Fluidbook.BOTTOM = 9;
 Fluidbook.prototype = {
-       init: function(datas) {
+       init: function (datas) {
                this.datas = datas;
                this.junk = datas.cacheDate;
                this.cache = new FluidbookCache(datas);
@@ -77,15 +77,15 @@ Fluidbook.prototype = {
                }
                this.initLoading();
        },
-       initLoading: function() {
+       initLoading: function () {
                this.displayLoader();
        },
-       reloadErrorImages: function() {
-               $('img').each(function() {
+       reloadErrorImages: function () {
+               $('img').each(function () {
 
                });
        },
-       hideSplash: function() {
+       hideSplash: function () {
                if ($("#splash").length == 0) {
                        return;
                }
@@ -96,26 +96,26 @@ Fluidbook.prototype = {
 
                this.loader.canPreload();
                var $this = this;
-               setTimeout(function() {
+               setTimeout(function () {
                        $this._hideSplash();
                }, 3000);
        },
-       _hideSplash: function() {
+       _hideSplash: function () {
                this.ready();
                $("#main").css('visibility', 'visible');
                this.hideLoader(0, true);
                if (this.support.transitions2d) {
-                       $("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(true), function() {
+                       $("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(true), function () {
                                $(this).remove();
                        });
                } else {
-                       $("#splash").fadeOut(500, function() {
+                       $("#splash").fadeOut(500, function () {
                                $(this.remove());
                        })
                }
 
        },
-       ready: function() {
+       ready: function () {
                if (this.isReady) {
                        return;
                }
@@ -127,22 +127,22 @@ Fluidbook.prototype = {
                resize();
                $(this).trigger('fluidbookready');
        },
-       loadPlugins: function() {
-               $.each(this.datas.plugins, function(k, plugin) {
+       loadPlugins: function () {
+               $.each(this.datas.plugins, function (k, plugin) {
                        try {
                                var functionName = plugin.replace(/\./g, '_');
                                eval(functionName + '();');
                        } catch (err) {
                        }
                });
-               $.each(this.datas.htmlmultimedia, function(k, code) {
+               $.each(this.datas.htmlmultimedia, function (k, code) {
                        try {
                                eval(code);
                        } catch (err) {
                        }
                });
        },
-       resetZoom: function() {
+       resetZoom: function () {
                var $this = this;
                if (this.support.iOS) {
                } else if (!this.support.isMobile) {
@@ -150,14 +150,14 @@ Fluidbook.prototype = {
                }
 
        },
-       setZoom: function(zoom) {
+       setZoom: function (zoom) {
                if (zoom) {
                        $("#pages").addClass('zoom');
                } else {
                        $("#pages").removeClass('zoom');
                }
        },
-       initPage: function(pageNr, doublePage, position) {
+       initPage: function (pageNr, doublePage, position) {
                if ($("#page_" + pageNr).length > 0) {
                        return;
                }
@@ -165,10 +165,10 @@ Fluidbook.prototype = {
                var page = '<div class="page ' + position + '" id="page_' + pageNr + '" data-page="' + pageNr + '"><div class="background" page="' + pageNr + '"></div><div class="clinks"></div><div class="texts" highlight=""></div><div class="shade"></div></div>';
                $(doublePage).append(page);
        },
-       hidePage: function(position) {
+       hidePage: function (position) {
                $("#pages ." + position).hide();
        },
-       initLinks: function(pageNr) {
+       initLinks: function (pageNr) {
                if (pageNr == undefined) {
                        pageNr = this.currentPage;
                }
@@ -191,40 +191,40 @@ Fluidbook.prototype = {
                if (this.datas.linkBlinkTime > 0) {
                        ///this.animateLinks();
                }
-               setTimeout(function() {
+               setTimeout(function () {
                        $this.initVideos();
                }, 1000);
        },
-       animateLinks: function() {
+       animateLinks: function () {
                var links = $(".link a.displayArea");
                var bookmarks = $("#links .bookmark:not([data-enabled])");
                if (Modernizr.csstransitions) {
                        $(links).addClass('animating');
                        $(bookmarks).css('opacity', 1).addClass('animating');
-                       setTimeout(function() {
+                       setTimeout(function () {
                                $(links).css('opacity', 0);
                                $(bookmarks).css('opacity', 0);
-                               setTimeout(function() {
+                               setTimeout(function () {
                                        $(links).removeClass('animating').css('opacity', 1);
                                        $(bookmarks).removeClass('animating').css('opacity', "");
                                }, 1100);
                        }, 50);
                } else {
-                       $(links).addClass('animating').fadeOut(1000, function() {
+                       $(links).addClass('animating').fadeOut(1000, function () {
                                $(links).removeClass('animating').show();
-                       }).mouseover(function() {
+                       }).mouseover(function () {
                                $(links).stop().removeClass('animating').css('opacity', 1).show();
                                return true;
                        });
                }
        },
-       initVideos: function() {
+       initVideos: function () {
                var $this = this;
-               $(".videoContainer").each(function() {
+               $(".videoContainer").each(function () {
                        $this.video.initVideo(this);
                });
        },
-       getNextOffset: function() {
+       getNextOffset: function () {
                var offset = 2;
                if (this.displayOnePage) {
                        offset = 1;
@@ -232,35 +232,35 @@ Fluidbook.prototype = {
                this.transitionAxis = 'x';
                return offset;
        },
-       goNextPage: function() {
+       goNextPage: function () {
                if (this.transitionning) {
                        return;
                }
                this.transitionAxis = 'x';
                this.setCurrentPage(this.normalizePage(this.currentPage) + this.getNextOffset());
        },
-       goFirstPage: function() {
+       goFirstPage: function () {
                if (this.transitionning) {
                        return;
                }
                this.transitionAxis = 'x';
                this.setCurrentPage(1);
        },
-       goPreviousPage: function() {
+       goPreviousPage: function () {
                if (this.transitionning) {
                        return;
                }
                this.transitionAxis = 'x';
                this.setCurrentPage(this.normalizePage(this.currentPage) - this.getNextOffset());
        },
-       goLastPage: function() {
+       goLastPage: function () {
                if (this.transitionning) {
                        return;
                }
                this.transitionAxis = 'x';
                this.setCurrentPage(this.datas.pages);
        },
-       goNextChapter: function() {
+       goNextChapter: function () {
                if (this.transitionning) {
                        return;
                }
@@ -271,7 +271,7 @@ Fluidbook.prototype = {
                this.transitionAxis = 'x';
                this.setCurrentPage(this.normalizePage(next));
        },
-       goPreviousChapter: function() {
+       goPreviousChapter: function () {
                if (this.transitionning) {
                        return;
                }
@@ -282,7 +282,7 @@ Fluidbook.prototype = {
                this.transitionAxis = 'x';
                this.setCurrentPage(this.normalizePage(prev));
        },
-       goNextChapterPage: function() {
+       goNextChapterPage: function () {
                if (this.transitionning) {
                        return;
                }
@@ -294,7 +294,7 @@ Fluidbook.prototype = {
                this.transitionAxis = 'y';
                this.setCurrentPage(this.normalizePage(next));
        },
-       goPreviousChapterPage: function() {
+       goPreviousChapterPage: function () {
                if (this.transitionning) {
                        return;
                }
@@ -306,17 +306,17 @@ Fluidbook.prototype = {
                this.transitionAxis = 'y';
                this.setCurrentPage(this.normalizePage(prev));
        },
-       normalizePage: function(page) {
+       normalizePage: function (page) {
                page = Math.max(1, Math.min(page, this.datas.pages));
                if (!this.displayOnePage && page % 2 == 1) {
                        page--;
                }
                return page;
        },
-       setCurrentPage: function(page) {
+       setCurrentPage: function (page) {
                window.location.hash = "#/page/" + this.normalizePage(page);
        },
-       changeAddress: function() {
+       changeAddress: function () {
                var $this = this;
                var page;
                var args = window.location.hash.split('/');
@@ -334,7 +334,7 @@ Fluidbook.prototype = {
                        }
 
                        $($this).trigger('changePage', [page]);
-                       this.closeView(function() {
+                       this.closeView(function () {
                                $this.pageTransition(page);
                                $this.resetZoom();
                                $this.stats.track(0, page);
@@ -342,7 +342,7 @@ Fluidbook.prototype = {
                        }, true);
                }
                else {
-                       this.openView(args[1], args[2], args[3], function() {
+                       this.openView(args[1], args[2], args[3], function () {
                                $this.hideSplash();
                        });
                        this.resetZoom();
@@ -350,7 +350,7 @@ Fluidbook.prototype = {
 
                return;
        },
-       pageTransition: function(pageNr) {
+       pageTransition: function (pageNr) {
                this.tooltip.hideTooltip();
                if (pageNr == undefined) {
                        pageNr = this.currentPage;
@@ -373,7 +373,7 @@ Fluidbook.prototype = {
 
                return this.pageTransition3D(pageNr);
        },
-       pageTransition3D: function(pageNr) {
+       pageTransition3D: function (pageNr) {
 
                var $this = this;
                if ($("#pages").hasClass('_3dtransition')) {
@@ -386,12 +386,12 @@ Fluidbook.prototype = {
                var doublePage = $("#nextDoublePage");
                var currentDoublePage = $("#currentDoublePage");
                this.displayLoader();
-               this.loader.preloadPagesBeforeTransition([turning.currentLeft, turning.currentRight], function() {
+               this.loader.preloadPagesBeforeTransition([turning.currentLeft, turning.currentRight], function () {
                        $("#pages").addClass('_3dtransition');
-                       $this.loader.setContentsInDoublePage(currentDoublePage, turning.flat, true, function() {
-                               $this.loader.setContentsInDoublePage(doublePage, turning.flip, true, function() {
+                       $this.loader.setContentsInDoublePage(currentDoublePage, turning.flat, true, function () {
+                               $this.loader.setContentsInDoublePage(doublePage, turning.flip, true, function () {
                                        $this.beforeTransition(pageNr, 3);
-                                       $(doublePage).addClass(turning.nextFromClass + 'end').one($this.support.getTransitionEndEvent(), function() {
+                                       $(doublePage).addClass(turning.nextFromClass + 'end').one($this.support.getTransitionEndEvent(), function () {
                                                if ($this.transitionning == false) {
                                                        return;
                                                }
@@ -402,7 +402,7 @@ Fluidbook.prototype = {
                                                }
 
                                                // Set the flat contents with the new page
-                                               $this.loader.setContentsInDoublePage(doublePage, turning.end, false, function() {
+                                               $this.loader.setContentsInDoublePage(doublePage, turning.end, false, function () {
                                                        $(doublePage).removeClass('_3d').removeClass(turning.nextFromClass + 'start').removeClass(turning.nextFromClass + 'end');
                                                        // Remove former part
                                                        $("#currentDoublePage").remove();
@@ -415,7 +415,7 @@ Fluidbook.prototype = {
                        });
                });
        },
-       getTurningPages: function(newPage) {
+       getTurningPages: function (newPage) {
                var res = {};
                res.dir = 1;
                if (newPage < this.currentPage) {
@@ -461,10 +461,10 @@ Fluidbook.prototype = {
                res.loading = [res.currentLeft, res.currentRight];
                return json_parse(JSON.stringify(res));
        },
-       reloadCurrentPage: function() {
+       reloadCurrentPage: function () {
                this.pageTransition(this.currentPage);
        },
-       readingPage: function(side) {
+       readingPage: function (side) {
                if (!this.displayOnePage) {
                        var page = this.currentPage;
                        var change = false;
@@ -480,7 +480,7 @@ Fluidbook.prototype = {
                        }
                }
        },
-       hideUnnecessaryButtons: function(page) {
+       hideUnnecessaryButtons: function (page) {
                var speed = 500;
                if (page == undefined) {
                        page = this.currentPage;
@@ -514,7 +514,7 @@ Fluidbook.prototype = {
                        }
                }
        },
-       updateShadows: function(page, animationDuration) {
+       updateShadows: function (page, animationDuration) {
                if (animationDuration == undefined) {
                        animationDuration = 0;
                }
@@ -552,21 +552,21 @@ Fluidbook.prototype = {
                        $("#shadow>.right:visible").fadeOut(duration);
                }
        },
-       showAllButtons: function() {
+       showAllButtons: function () {
                $("#next,#previous").addClass('help').show();
        },
-       pageTransition2D: function(pageNr) {
+       pageTransition2D: function (pageNr) {
                this.transitionning = true;
                var $this = this;
                var turning = this.getTurningPages(pageNr);
                $("#pages").append('<div id="nextDoublePage" class="doublePage _2d axis_' + this.transitionAxis + ' ' + turning.nextFromClass + '"></div>');
                var doublePage = $("#nextDoublePage");
                this.displayLoader();
-               this.loader.preloadPagesBeforeTransition(turning.end, function() {
-                       $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function() {
+               this.loader.preloadPagesBeforeTransition(turning.end, function () {
+                       $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function () {
                                $this.beforeTransition(pageNr, 2);
                                $("#currentDoublePage").addClass('_2d').addClass('axis_' + $this.transitionAxis).addClass(turning.currentToClass);
-                               $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function(event) {
+                               $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function (event) {
                                        if ($this.transitionning == false) {
                                                return;
                                        }
@@ -577,7 +577,7 @@ Fluidbook.prototype = {
                        });
                });
        },
-       pageTransition2DPortrait: function(pageNr) {
+       pageTransition2DPortrait: function (pageNr) {
                this.transitionning = true;
                var $this = this;
                var turning = this.getTurningPages(pageNr);
@@ -588,11 +588,11 @@ Fluidbook.prototype = {
                }
 
                this.displayLoader();
-               this.loader.preloadPagesBeforeTransition(turning.end, function() {
-                       $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function() {
+               this.loader.preloadPagesBeforeTransition(turning.end, function () {
+                       $this.loader.setContentsInDoublePage(doublePage, turning.end, true, function () {
                                $this.beforeTransition(pageNr, 2);
                                $("#currentDoublePage").addClass('axis_' + $this.transitionAxis).addClass('_2d').addClass(turning.currentToClass);
-                               $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function() {
+                               $(doublePage).removeClass(turning.nextFromClass).one($this.support.getTransitionEndEvent(), function () {
                                        fb('received event');
                                        if ($this.transitionning == false) {
                                                return;
@@ -604,7 +604,7 @@ Fluidbook.prototype = {
                        });
                });
        },
-       pageTransition1D: function(pageNr) {
+       pageTransition1D: function (pageNr) {
                var page = pageNr;
                var doublePage = $("#currentDoublePage");
                var $this = this;
@@ -613,11 +613,11 @@ Fluidbook.prototype = {
                }
                var turning = this.getTurningPages(pageNr);
                this.beforeTransition(pageNr);
-               this.loader.setContentsInDoublePage(doublePage, turning.end, true, function() {
+               this.loader.setContentsInDoublePage(doublePage, turning.end, true, function () {
                        $this.afterTransition(page);
                });
        },
-       beforeTransition: function(page, d) {
+       beforeTransition: function (page, d) {
                if (d == undefined) {
                        d = 1;
                }
@@ -630,7 +630,7 @@ Fluidbook.prototype = {
                this.updateShadows(page, animationDuration);
                fb('beforeTransition ' + page);
        },
-       afterTransition: function(page) {
+       afterTransition: function (page) {
                if (this.transitionning === false) {
                        //return;
                }
@@ -638,7 +638,7 @@ Fluidbook.prototype = {
                var $this = this;
                this.currentPage = page;
                this.setPageNumbers();
-               setTimeout(function() {
+               setTimeout(function () {
                        $this.loader.preloadAround(page);
                }, 1000);
                this.initLinks();
@@ -670,35 +670,35 @@ Fluidbook.prototype = {
                }
 
        },
-       setPageNumbers: function() {
+       setPageNumbers: function () {
                $("#pagesnumbers .left").html(this.getPageNumberOfSide('left'));
                $("#pagesnumbers .right").html(this.getPageNumberOfSide('right'));
        },
-       getPageNumberOfSide: function(side) {
+       getPageNumberOfSide: function (side) {
                var p = $("#currentDoublePage").find('.' + side);
                if (p.length == 0) {
                        return '';
                }
                return this.physicalToVirtual($(p).data('page'));
        },
-       clickLogo: function() {
+       clickLogo: function () {
                if (this.datas.url_link == '' || this.datas.url_link == 'http://') {
                        return;
                }
                this.wopen(this.datas.url_link, '_blank');
        },
-       viewMode: function() {
+       viewMode: function () {
                return $("#view .mview").length > 0;
        },
-       openView: function(view, param1, param2, callback) {
+       openView: function (view, param1, param2, callback) {
                var $this = this;
                this.displayLoader();
                this.resetWaiters();
-               setTimeout(function() {
+               setTimeout(function () {
                        $this._openView(view, param1, param2, callback);
                }, 20);
        },
-       addWaiter: function(reset) {
+       addWaiter: function (reset) {
                if (reset == undefined) {
                        reset = false;
                }
@@ -709,13 +709,13 @@ Fluidbook.prototype = {
                this.waiters.push(rand);
                return rand;
        },
-       waiterActive: function(id) {
+       waiterActive: function (id) {
                return this.waiters.indexOf(id) > -1;
        },
-       resetWaiters: function() {
+       resetWaiters: function () {
                this.waiters = [];
        },
-       _openView: function(view, param1, param2, callback) {
+       _openView: function (view, param1, param2, callback) {
                var $this = this;
                var preload = {index: 'thumbnails',
                        search: 'thumbnails',
@@ -723,7 +723,7 @@ Fluidbook.prototype = {
                        video: 'extras'};
                if (!OFFLINEAPP && this.gal != null && preload[view] != undefined) {
                        var w = this.addWaiter(true);
-                       this.gal.downloadAndCall(preload[view], function() {
+                       this.gal.downloadAndCall(preload[view], function () {
                                if ($this.waiterActive(w)) {
                                        $this.__openView(view, param1, param2, callback);
                                }
@@ -732,10 +732,10 @@ Fluidbook.prototype = {
                        this.__openView(view, param1, param2, callback);
                }
        },
-       __openView: function(view, param1, param2, callback) {
+       __openView: function (view, param1, param2, callback) {
                var $this = this;
                var camelView = view.charAt(0).toUpperCase() + view.substr(1);
-               var cb = function() {
+               var cb = function () {
                        $this.openingView(callback);
                };
                if (view == 'index') {
@@ -744,7 +744,7 @@ Fluidbook.prototype = {
                        this.searchString = param1;
                        var group = param2;
                        $("#q").val(param1);
-                       this.search.find(param1, function(r) {
+                       this.search.find(param1, function (r) {
                                $this.displayResults(r, group, cb);
                        });
                        if (group == undefined) {
@@ -766,7 +766,7 @@ Fluidbook.prototype = {
                        this['open' + camelView](param1, param2, cb);
                }
        },
-       openingView: function(callback) {
+       openingView: function (callback) {
                var $this = this;
                this.resize.resizeView();
                this.tooltip.hideTooltip();
@@ -792,8 +792,8 @@ Fluidbook.prototype = {
                        }
 
                        $(mview).show().removeClass('animate').transform(from);
-                       setTimeout(function() {
-                               $(mview).one($this.support.getTransitionEndEvent(), function() {
+                       setTimeout(function () {
+                               $(mview).one($this.support.getTransitionEndEvent(), function () {
                                        $("#main").hide();
                                        $('body').addClass('view');
                                        $(mview).removeClass('animate');
@@ -811,7 +811,7 @@ Fluidbook.prototype = {
                        resize();
                }
        },
-       displayResults: function(data, group, callback) {
+       displayResults: function (data, group, callback) {
                var $this = this;
                var results = data.results;
                var hideNoResults = !this.datas.searchShowNoResultsPages;
@@ -821,17 +821,17 @@ Fluidbook.prototype = {
                        return;
                }
 
-               this.openIndex(this.l10n.__('search results for') + ' &laquo; ' + this.searchString + " &raquo;", group, false, function() {
+               this.openIndex(this.l10n.__('search results for') + ' &laquo; ' + this.searchString + " &raquo;", group, false, function () {
                        var hits = [];
                        for (var i = 0; i <= $this.datas.pages; i++) {
                                hits[i] = 0;
                        }
 
-                       $.each(results, function(k, v) {
+                       $.each(results, function (k, v) {
                                hits[k] += v;
                        });
                        var e = encodeURIComponent($this.searchString);
-                       $(".doubleThumb").each(function() {
+                       $(".doubleThumb").each(function () {
                                var pages = $(this).data('pages').toString().split(',');
                                var hitsp = 0;
                                var pagesWithHits = [];
@@ -874,7 +874,7 @@ Fluidbook.prototype = {
                        }
                });
        },
-       openMultimedia: function(multimedia, callback) {
+       openMultimedia: function (multimedia, callback) {
                var a = $('a[href="#/multimedia/' + multimedia + '"]');
                var markup = decodeURIComponent($(a).attr('data-multimedia'));
                var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
@@ -886,7 +886,7 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openVideo: function(video, callback) {
+       openVideo: function (video, callback) {
                var a = $('a[href="#/video/' + video + '"]');
                var markup = decodeURIComponent($(a).attr('data-video'));
                var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
@@ -898,8 +898,8 @@ Fluidbook.prototype = {
                this.initVideos();
                var $this = this;
                var times = [250, 500, 750, 1000, 1250];
-               $.each(times, function(k, v) {
-                       setTimeout(function() {
+               $.each(times, function (k, v) {
+                       setTimeout(function () {
                                $this.resize.resizePopupVideos();
                        }, v);
                });
@@ -907,7 +907,7 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openAudio: function(audio, callback) {
+       openAudio: function (audio, callback) {
                var a = $('a[href="#/audio/' + audio + '"]');
                var markup = decodeURIComponent($(a).attr('data-audio'));
                var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
@@ -918,8 +918,8 @@ Fluidbook.prototype = {
                this.stats.track(11);
                var $this = this;
                var times = [250, 500, 750, 1000, 1250];
-               $.each(times, function(k, v) {
-                       setTimeout(function() {
+               $.each(times, function (k, v) {
+                       setTimeout(function () {
                                $this.resize.resizePopupAudios();
                        }, v);
                });
@@ -927,7 +927,7 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openWebVideo: function(service, video, callback) {
+       openWebVideo: function (service, video, callback) {
 
                var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a></div>';
                view += '<div class="content">';
@@ -938,7 +938,7 @@ Fluidbook.prototype = {
                }
                view += '</div>';
                $("#view").append('<div class="mview">' + view + '</div>');
-               $("#view .mview:last iframe").each(function() {
+               $("#view .mview:last iframe").each(function () {
                        $(this).attr('height', ($(this).width() * 9) / 16);
                });
                this.stats.track(11);
@@ -946,12 +946,12 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openLocales: function(p1, p2, callback) {
+       openLocales: function (p1, p2, callback) {
                var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a><h2>Select language</h2></div>';
                view += '<div class="content">';
                view += '<ul class="chapters localesList">';
                var $this = this;
-               $.each(this.l10n.multilang, function(k, v) {
+               $.each(this.l10n.multilang, function (k, v) {
                        var url = v.url;
                        if (url.substr(0, 3) == '../' && !$this.datas.standalone) {
                                url = '../' + url;
@@ -983,7 +983,7 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openShare: function(p1, p2, callback) {
+       openShare: function (p1, p2, callback) {
                var view = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a><h2>' + this.l10n.__('share') + '</h2></div>';
                view += '<div class="content">';
                view += '<ul class="chapters shareList">';
@@ -1013,7 +1013,7 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openBookmark: function(p1, p2, callback) {
+       openBookmark: function (p1, p2, callback) {
                var view = this.bookmarks.getView();
                if (view !== false) {
                        $("#view").append('<div class="mview">' + view + '</div>');
@@ -1023,7 +1023,7 @@ Fluidbook.prototype = {
                } else {
                        var message = this.l10n.__("you don't have any bookmarks");
                        if (this.datas.phonegap) {
-                               navigator.notification.alert(message, function() {
+                               navigator.notification.alert(message, function () {
 
                                }, this.l10n.__('bookmarks'));
                        } else {
@@ -1033,7 +1033,7 @@ Fluidbook.prototype = {
                        this.hideLoader();
                }
        },
-       openChapters: function(callback) {
+       openChapters: function (callback) {
                if (this.chapters == undefined) {
                        this.chapters = new FluidbookChapters(this, this.datas.chapters);
                }
@@ -1047,7 +1047,7 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openIndex: function(title, group, closeAll, callback) {
+       openIndex: function (title, group, closeAll, callback) {
                var c = !closeAll ? ' one' : '';
                var index = '<div class="caption"><a href="#" class="back' + c + '">' + this.l10n.__('back') + '</a><h2>' + title + '</h2></div>';
                index += this.index.getView(group);
@@ -1057,7 +1057,7 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       openArchives: function(title, callback) {
+       openArchives: function (title, callback) {
                var archives = '<div class="caption"><a href="#" class="back">' + this.l10n.__('back') + '</a><h2>' + title + '</h2></div>';
                archives += '<div class="image" id="archivesview"><img src="data/images/' + this.datas.externalArchives + '" /><div class="links">' + this.datas.links.archives + '</div></div>';
                $("#view").append('<div class="mview archives">' + archives + '</div>');
@@ -1065,13 +1065,13 @@ Fluidbook.prototype = {
                        callback();
                }
        },
-       physicalToVirtual: function(page) {
+       physicalToVirtual: function (page) {
                return this.datas.numerotation[page - 1];
        },
-       virtualToPhysical: function(page) {
+       virtualToPhysical: function (page) {
                return this.datas.numerotation.indexOf(page) + 1;
        },
-       closeView: function(callback, all, animate) {
+       closeView: function (callback, all, animate) {
                var $this = this;
                if (all == undefined) {
                        all = false;
@@ -1080,7 +1080,7 @@ Fluidbook.prototype = {
                        animate = true;
                }
                if ($('.mview').scrollTop() > 0) {
-                       $('.mview').scrollTo(0, 500, function() {
+                       $('.mview').scrollTo(0, 500, function () {
                                $this.closeView(callback, all, animate);
                        });
                        return;
@@ -1105,8 +1105,8 @@ Fluidbook.prototype = {
                }
 
                if (animate && this.support.transitions2d) {
-                       setTimeout(function() {
-                               $(mview).one($this.support.getTransitionEndEvent(), function() {
+                       setTimeout(function () {
+                               $(mview).one($this.support.getTransitionEndEvent(), function () {
                                        $(this).remove();
                                        callback();
                                }).addClass('animate').transform(to);
@@ -1121,21 +1121,21 @@ Fluidbook.prototype = {
                }
                resize();
        },
-       getSearchHints: function(q) {
+       getSearchHints: function (q) {
 
                var $this = this;
                this.killLastSearchHint();
-               this.search.getHints(q, function(r) {
+               this.search.getHints(q, function (r) {
                        $this.displaySearchHints(r);
                });
        },
-       displaySearchHints: function(hints) {
+       displaySearchHints: function (hints) {
 
                this.hideSearchHints();
                if (hints.length == 0) {
                        return;
                }
-               $.each(hints, function(k, v) {
+               $.each(hints, function (k, v) {
                        $("#searchHints").append('<a class="hint" term="' + v[0] + '" href="#/search/' + v[0] + '">' + v[0] + ' <em>(' + v[1] + ')</em></a>');
                });
                var qoffset = $("#q").offset();
@@ -1146,15 +1146,15 @@ Fluidbook.prototype = {
                }
                $("#searchHints").css({top: top, left: left}).show();
        },
-       killLastSearchHint: function() {
+       killLastSearchHint: function () {
                this.search.kill();
        },
-       hideSearchHints: function() {
+       hideSearchHints: function () {
                this.killLastSearchHint();
                $("#searchHints").html('');
                $("#searchHints").hide();
        },
-       getLocationToShare: function() {
+       getLocationToShare: function () {
                if (this.datas.phonegap) {
                        return this.datas.offlineLink;
                } else {
@@ -1163,42 +1163,42 @@ Fluidbook.prototype = {
                        return e[0];
                }
        },
-       sendEmail: function() {
+       sendEmail: function () {
                window.location = 'mailto:?subject=' + this.datas.title + '&body=' + this.datas.title + ' : ' + this.getLocationToShare();
                this.stats.track(5);
        },
-       sendTwitter: function() {
+       sendTwitter: function () {
                this.service.open('twitterShare', {
                        url: this.getLocationToShare(),
                        post: this.datas.twitter_description.replace('%title%', this.datas.title)
                });
                this.stats.track(13);
        },
-       sendFacebook: function() {
+       sendFacebook: function () {
                this.service.open('facebookShare', {
                        url: this.getLocationToShare()
                });
                this.stats.track(12);
        },
-       sendGoogleplus: function() {
+       sendGoogleplus: function () {
                this.service.open('googleplusShare', {
                        url: this.getLocationToShare()
                });
                this.stats.track(12);
        },
-       sendLinkedin: function() {
+       sendLinkedin: function () {
                this.service.open('linkedinShare', {
                        url: this.getLocationToShare()
                });
                this.stats.track(12);
        },
-       sendViadeo: function() {
+       sendViadeo: function () {
                this.service.open('viadeoShare', {
                        url: this.getLocationToShare()
                });
                this.stats.track(12);
        },
-       print: function() {
+       print: function () {
                var $this = this;
                var pdf;
                var pdfName;
@@ -1211,14 +1211,14 @@ Fluidbook.prototype = {
                pdfName = e.pop();
                if (this.gal && !OFFLINEAPP) {
                        this.displayLoader();
-                       this.gal.downloadAndCall('extras', function() {
+                       this.gal.downloadAndCall('extras', function () {
                                $this._openFile(pdf, $("#print"), 'pdf', pdfName);
                        });
                } else {
                        this._openFile(pdf, $("#print"), 'pdf', pdfName);
                }
        },
-       _openFile: function(url, e, type, localname) {
+       _openFile: function (url, e, type, localname) {
 
                var $this = this;
                if (this.datas.phonegap != false) {
@@ -1238,21 +1238,21 @@ Fluidbook.prototype = {
                }
                this.wopen(url, '_blank');
        },
-       _downloadFilePhonegap: function(url, localname, fs, callback, callbackArgs) {
+       _downloadFilePhonegap: function (url, localname, fs, callback, callbackArgs) {
                var $this = this;
                if (fs == undefined) {
                        fs = LocalFileSystem.PERSISTENT;
                }
 
-               window.requestFileSystem(fs, 0, function(fileSystem) {
-                       fileSystem.root.getFile("dummy.html", {create: true, exclusive: false}, function(fileEntry) {
+               window.requestFileSystem(fs, 0, function (fileSystem) {
+                       fileSystem.root.getFile("dummy.html", {create: true, exclusive: false}, function (fileEntry) {
                                var filePath = fileEntry.fullPath.replace("dummy.html", "") + localname;
                                var fileTransfer = new FileTransfer();
                                var uri = encodeURI(url);
                                fileTransfer.download(
                                                uri,
                                                filePath,
-                                               function(entry) {
+                                               function (entry) {
                                                        if (callback != undefined) {
                                                                if (callbackArgs == undefined) {
                                                                        callbackArgs = [];
@@ -1261,16 +1261,16 @@ Fluidbook.prototype = {
                                                                callback.apply($this, callbackArgs);
                                                        }
                                                },
-                                               function(error) {
+                                               function (error) {
 
                                                }
                                );
                        });
-               }, function() {
+               }, function () {
 
                });
        },
-       _openFilePhonegap: function(url, e, type) {
+       _openFilePhonegap: function (url, e, type) {
                var $this = this;
                var types_ios = {pdf: 'com.adobe.pdf'};
                var types_android = {pdf: 'application/pdf'};
@@ -1281,9 +1281,9 @@ Fluidbook.prototype = {
                                offset.left += ($(e).width() / 2);
                                offset.top += ($(e).height());
                                try {
-                                       ExternalFileUtil.openWith(url, types_ios[type], function() {
+                                       ExternalFileUtil.openWith(url, types_ios[type], function () {
                                                $this.hideLoader();
-                                       }, function() {
+                                       }, function () {
                                                $this.wopen(url, "_blank", 'location=no');
                                                $this.hideLoader();
                                        }, offset);
@@ -1297,14 +1297,14 @@ Fluidbook.prototype = {
                if (this.datas.phonegap == 'android') {
                        if (types_android[type] != undefined) {
                                this.displayLoader();
-                               setTimeout(function() {
+                               setTimeout(function () {
                                        CDV.WEBINTENT.startActivity({
                                                action: CDV.WEBINTENT.ACTION_VIEW,
                                                type: types_android[type],
                                                url: url
-                                       }, function(args) {
+                                       }, function (args) {
                                                $this.hideLoader(5);
-                                       }, function(args) {
+                                       }, function (args) {
                                                $this.hideLoader(5);
                                        });
                                }, 100);
@@ -1313,23 +1313,23 @@ Fluidbook.prototype = {
                }
                return false;
        },
-       highlightSearchTerms: function(pageNr) {
+       highlightSearchTerms: function (pageNr) {
                return;
        },
-       touchOffset: function(offset) {
+       touchOffset: function (offset) {
                offset *= $("#currentDoublePage").width();
                $("#currentDoublePage").addClass('sliding');
                $("#currentDoublePage").css({
                        translateX: offset
                });
        },
-       displayLoader: function() {
+       displayLoader: function () {
                this.coquillette.show();
                if (!this.support.isMobile) {
                        $('body').addClass('loading');
                }
        },
-       hideLoader: function(delay, force) {
+       hideLoader: function (delay, force) {
                if (force == undefined) {
                        force = false;
                }
@@ -1340,11 +1340,11 @@ Fluidbook.prototype = {
                if (delay == 0) {
                        return this._hideLoader(force);
                }
-               setTimeout(function() {
+               setTimeout(function () {
                        $this._hideLoader(force);
                }, delay * 1000);
        },
-       _hideLoader: function(force) {
+       _hideLoader: function (force) {
                if (force == undefined) {
                        force = false;
                }
@@ -1358,7 +1358,7 @@ Fluidbook.prototype = {
                        $('body').removeClass('loading');
                }
        },
-       pollZoom: function() {
+       pollZoom: function () {
                var z = this.support.getZoomLevel();
                //console.log(z);
                $('html').attr('data-zoom', z);
@@ -1368,7 +1368,7 @@ Fluidbook.prototype = {
                        $("html").addClass('pan');
                }
        },
-       intentShare: function(subject, body) {
+       intentShare: function (subject, body) {
                if (subject == undefined) {
                        subject = this.datas.title;
                }
@@ -1384,15 +1384,15 @@ Fluidbook.prototype = {
                                action: CDV.WEBINTENT.ACTION_SEND,
                                type: 'text/plain',
                                extras: extras
-                       }, function(args) {
-                       }, function(args) {
+                       }, function (args) {
+                       }, function (args) {
                        });
                } else {
                        window.location = 'mailto:?subject=' + subject + '&body=' + body;
                }
                this.stats.track(5);
        },
-       wopen: function(url, target, options) {
+       wopen: function (url, target, options) {
                if (target == undefined) {
                        target = '_self';
                }
@@ -1412,5 +1412,4 @@ Fluidbook.prototype = {
                }
                window.open(url, target, options);
        }
-}
-
+}
\ No newline at end of file