From: Vincent Vanwaelscappel Date: Thu, 5 Apr 2018 13:49:17 +0000 (+0200) Subject: wip #2021 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=001a0d0eca3d12d02813d4ce47115ff2863ff9d9;p=fluidbook-html5.git wip #2021 @0.75 --- diff --git a/js/libs/fluidbook/fluidbook.menu.js b/js/libs/fluidbook/fluidbook.menu.js index c48741c5..2699f500 100644 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@ -258,8 +258,35 @@ FluidbookMenu.prototype = { openShare: function (p1, p2, callback) { this.fluidbook.share.openShare(p1, p2, callback); }, + + openBookmarkHelp: function (p1, p2, callback) { + // __("you don't have any bookmark. to add a bookmark, please click on the icon in the page corner") + //var message = this.fluidbook.l10n.translate("you don't have any bookmark. to add a bookmark, please click on the icon in the page corner") + var message = __("you don't have any bookmark. to add a bookmark, please click on the icon in the page corner"); + var view = '
' + this.fluidbook.menu.closeButton() + '

'; + view += '
'; + view += '
'; + view += '

' + message + '

'; + view += '
'; + view += '
'; + view += '
'; + view += ''; + view += '
'; + view += '
'; + $("#view").append('
' + view + '
'); + + this.fluidbook.loader.getThumbImage(2, $("#view .thumb.left .img"), false, 147); + this.fluidbook.loader.getThumbImage(3, $("#view .thumb.right .img"), false, 147); + + if (callback != undefined) { + callback(); + } + }, + openBookmark: function (p1, p2, callback) { - console.log('!!' + JSON.stringify(p1)); + if (!this.fluidbook.bookmarks.hasBookmarkedPages()) { + return this.openBookmarkHelp(p1, p2, callback); + } var title = ''; var downloadLabel = ''; try { @@ -280,25 +307,11 @@ FluidbookMenu.prototype = { } var view = this.fluidbook.bookmarks.getView(title, downloadLabel); - if (view !== false) { - $("#view").append('
' + view + '
'); - if (callback != undefined) { - callback(); - } - } else { - var message = this.fluidbook.l10n.__("you don't have any bookmarks"); - if (this.fluidbook.datas.phonegap) { - navigator.notification.alert(message, function () { - - }, this.fluidbook.l10n.__('bookmarks')); - } else { - window.alert(message); - window.history.back(); - } - this.fluidbook.hideLoader(); + $("#view").append('
' + view + '
'); + if (callback != undefined) { + callback(); } - } - , + }, openChapters: function (submenu, callback) { if (this.fluidbook.datas.externalChaptersHTML != '') { this.openExternalChapters(callback); @@ -460,6 +473,12 @@ FluidbookMenu.prototype = { fullscreen = true; } break; + case 'bookmarks-help': + w = 420; + if (ww < 520) { + fullscreen = true; + } + break; case 'webvideo': var w = Math.max(ww * 0.8, 600); h = (w / 16) * 9; @@ -549,13 +568,30 @@ FluidbookMenu.prototype = { if (s < 1) { - var css = {overflow: 'hidden', width: nw * s, height: nh * s, top: y, left: x, position: 'absolute'}; + var css = { + overflow: 'hidden', + width: nw * s, + height: nh * s, + top: y, + left: x, + position: 'absolute' + }; m.find('.multimediaHolder').css(css); } else { - m.find('.multimediaHolder').css({position: "", overflow: '', width: '', height: '', top: '', left: ''}); + m.find('.multimediaHolder').css({ + position: "", + overflow: '', + width: '', + height: '', + top: '', + left: '' + }); } - m.find('.multimediaScale').css({width: nw, height: nh, overflow: 'hidden'}).transform({scale: [s, s], origin: [0, 0]}).css('text-align', 'left'); + m.find('.multimediaScale').css({width: nw, height: nh, overflow: 'hidden'}).transform({ + scale: [s, s], + origin: [0, 0] + }).css('text-align', 'left'); break; default: break; diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index c62713c2..8f1ade3e 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -669,16 +669,6 @@ FluidbookNav.prototype = { // Bookmarks icon $(document).on('click', '.icon-bookmarks', function () { - if (!$this.fluidbook.bookmarks.hasBookmarkedPages()) { - var message = $this.fluidbook.l10n.__("you don't have any bookmarks"); - if ($this.fluidbook.datas.phonegap) { - navigator.notification.alert(message, function () { - }, $this.fluidbook.l10n.__('bookmarks')); - } else { - window.alert(message); - } - return false; - } if ($(this).data('extra') != null) { $this.fluidbook.menu.openView('bookmark', $(this).data('extra'), null, function () { }); diff --git a/style/fluidbook.less b/style/fluidbook.less index 2ff8f206..f53b3809 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -1079,25 +1079,27 @@ html.ios body.portrait #interface { text-align: center; } - @w: 147px; + @w: 100px; .doubleThumb { position: relative; width: @w*2; height: @w/@book-page-ratio; margin: 0 auto; .thumb { + &:before { display: none; } &.left { margin-right: @w; + } &.right { left: @w; .img { &:after { left: auto; - right: -24px; + right: -20px; } } } @@ -1108,14 +1110,15 @@ html.ios body.portrait #interface { position: relative; width: @w; height: @w/@book-page-ratio; + &:after { content: ""; position: absolute; z-index: -1; - top: -24px; - left: -24px; - width: 90px; - height: 90px; + top: -20px; + left: -20px; + width: 75px; + height: 75px; background-color: @menu-background; border: 2px solid #fff; border-radius: 50%; @@ -1124,8 +1127,8 @@ html.ios body.portrait #interface { } .bookmark { - width: 60px; - height: 60px; + width: 45px; + height: 45px; z-index: 2; }