]> _ Git - fluidbook-html5.git/commitdiff
(no commit message)
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Sep 2013 10:59:53 +0000 (10:59 +0000)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Sep 2013 10:59:53 +0000 (10:59 +0000)
js/libs/fluidbook/fluidbook.help.js
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/fluidbook.tooltip.js
style/fluidbook.css

index c3276f4c4e746d83c8fb4ea778c8470d4d6b8043..bbd9c1125c9cac01e3bcc8f622c1721caea6a153 100644 (file)
@@ -48,15 +48,19 @@ FluidbookHelp.prototype = {
                }, {\r
                        preserve: true\r
                });\r
-               var h = 40 + ($("#nav>a").length - 1) * 25;\r
-               $("nav>a").each(function() {\r
+               var h = 40 + ($("#nav a[data-tooltip]").length - 1) * 25;\r
+               $("#nav a[data-tooltip]").each(function() {\r
                        var text = $(this).data('tooltip');\r
                        if (text == null || text == undefined || text == '') {\r
                                return;\r
                        }\r
-                       var offset = $(this).position();\r
-                       var left = 30 + offset.left;\r
-                       help += '<div class="icon" style="padding-top:' + h + 'px;left:' + left + 'px;">' + text + '</div>';\r
+                       var offset = $(this).offset();\r
+                       var left = offset.left + ($(this).width() / 2);\r
+                       var c = 'nav';\r
+                       if ($(this).parents("#afterSearch").length > 0) {\r
+                               c = 'afterSearch';\r
+                       }\r
+                       help += '<div class="icon '+c+'" style="padding-top:' + h + 'px;left:' + left + 'px;"><span>' + text + '</span></div>';\r
                        h -= 25;\r
                });\r
                $("#nav").transform({\r
@@ -188,7 +192,7 @@ FluidbookHelp.prototype = {
                });\r
 \r
                $("#helpView #icons").css({\r
-                       fontSize: (16 / navScale) * interfaceScale\r
+                       fontSize: (14 / navScale) * interfaceScale\r
                });\r
 \r
                $("#helpView .illustration").transform({\r
index 9b29ed2341c2a700a46494c24a77f9bfa01f3322..fa5fdd4c15e35db1d014c9dadef74528cb47a390 100644 (file)
@@ -347,6 +347,7 @@ Fluidbook.prototype = {
                return;\r
        },\r
        pageTransition: function(pageNr) {\r
+               this.tooltip.hideTooltip();\r
                if (pageNr == undefined) {\r
                        pageNr = this.currentPage;\r
                        if (pageNr == -1) {\r
@@ -756,6 +757,7 @@ Fluidbook.prototype = {
        openingView: function(callback) {\r
                var $this = this;\r
                this.resize.resizeView();\r
+               this.tooltip.hideTooltip();\r
 \r
                var mview = $('#view .mview:last');\r
 \r
@@ -1177,6 +1179,7 @@ Fluidbook.prototype = {
                this._openFile(pdf, $("#print"), 'pdf', this.datas.pdfName);\r
        },\r
        _openFile: function(url, e, type, localname) {\r
+\r
                var $this = this;\r
 \r
                if (this.datas.phonegap != false) {\r
@@ -1194,7 +1197,7 @@ Fluidbook.prototype = {
                        }\r
 \r
                }\r
-               this.wopen(url);\r
+               this.wopen(url, '_blank');\r
        },\r
        _downloadFilePhonegap: function(url, localname, fs, callback, callbackArgs) {\r
                var $this = this;\r
index 0700582d8e6eff6867c0587dfb42d1ee7833e2ec..4ddeb8e5a7a0d3cd2a12a1648ccd8a8bebb7ba30 100644 (file)
@@ -1,7 +1,9 @@
 function FluidbookNav(fluidbook) {
        this.fluidbook = fluidbook;
        this._dimensions = this.fluidbook.datas.iconsDimensions;
+       this._inited = false;
        this.setNav();
+       
 }
 
 FluidbookNav.prototype = {
@@ -36,7 +38,7 @@ FluidbookNav.prototype = {
                if (className != undefined) {
                        res += ' class="' + className + '"';
                }
-               if (help!=undefined && help != '') {
+               if (help != undefined && help != '') {
                        res += ' data-tooltip="' + this.fluidbook.l10n.__(help) + '"';
                }
                res += '>';
@@ -45,6 +47,10 @@ FluidbookNav.prototype = {
                return res;
        },
        setNav: function() {
+               if (this._inited == true) {
+                       return;
+               }
+               this._inited = true;
                /*
                 * __('overview')
                 * __('chapters')
@@ -104,9 +110,9 @@ FluidbookNav.prototype = {
                                        });
                                }
                        } else if (icon == 'pdf' || icon == 'print') {
-                               if (this.fluidbook.datas.print || this.fluidbook.datas.pdf) {
+                               if ($("#print").length==0 && (this.fluidbook.datas.print || this.fluidbook.datas.pdf)) {
                                        this.addLink('nav-print', '#', 'print', '!' + this.fluidbook.l10n.__('print') + ' | ' + this.fluidbook.l10n.__('download pdf'));
-                                       $("#print").click(function() {
+                                       $("#print").on('click', function() {
                                                $this.fluidbook.print();
                                                return false;
                                        });
index aa24c77f1af32887ae5f7f2288e35ef354d9c569..42dbce84477df6769745240a94186b6092c5ae32 100644 (file)
@@ -1,6 +1,5 @@
 function FluidbookTooltip(fluidbook) {
        this.fluidbook = fluidbook;
-       return false;
        this.init();
 }
 
@@ -12,13 +11,17 @@ FluidbookTooltip.prototype = {
                        position.top += $(this).outerHeight() + 20;
 
                        var text = $(this).data('tooltip');
+                       if (text.substr(0, 1) == '~') {
+                               var text = $this.fluidbook.l10n.__(text.substring(1));
+                               $(this).data('tooltip', text);
+                       }
                        var ok = $this.displayTooltip(text, position);
                        if (ok) {
                                $(this).one('mouseout', function() {
                                        $this.hideTooltip();
                                });
                        }
-                       return true;
+                       return false;
                });
                $("body").append('<div id="tooltip"></div>');
        },
@@ -26,7 +29,7 @@ FluidbookTooltip.prototype = {
                if (tooltip == undefined || tooltip == '') {
                        return false;
                }
-               position.left-=10;
+               position.left -= 10;
                $("#tooltip").text(tooltip).css(position).show();
                return true;
        },
index 780487cd5ac44b713826c88fe9ebba330aa333ae..1d7be920a13718f90dd8cb498ee91e855c423ea5 100644 (file)
@@ -829,7 +829,10 @@ ul.chapters.shareList a.level0 img{
 #helpView #icons{\r
        position:absolute;\r
        top:0px;\r
-       font-size:16px;\r
+}\r
+\r
+.portrait #helpView .icon.afterSearch{\r
+       display:none;\r
 }\r
 \r
 #helpView .icon{\r
@@ -837,9 +840,8 @@ ul.chapters.shareList a.level0 img{
        top:0px;\r
        display:inline-block;\r
        border-left: 1px solid #ffffff;\r
-       text-align: left;\r
-       width:400px;\r
        padding-left:5px;\r
+       white-space: nowrap;\r
 }\r
 \r
 #helpView .interface hr{\r