From 3bb983747bf82649f5e2662442139c7aecfe4d77 Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Mon, 26 Jun 2017 21:14:06 +0200 Subject: [PATCH] Done #1500 @0.5 --- js/libs/fluidbook/fluidbook.nav.js | 38 ++++++++++++------------ plugins/com/promotal/catalogue/plugin.js | 8 ++--- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index e52ba24d..193915ae 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -75,18 +75,18 @@ FluidbookNav.prototype = { // } // return this.fluidbook.loader.getImage(src, this._dimensions[name][0], this._dimensions[name][1]); // }, - addLink: function (name, href, id, help, before, c) { + addLink: function (name, href, id, title, help, before, c) { if (this.menu.find('#' + id).length > 0) { return; } - var l = '
  • ' + this.getLink(name, href, id, help, c) + '
  • '; + var l = '
  • ' + this.getLink(name, href, id, title, help, c) + '
  • '; if (before == undefined) { this.menu.find('ul').append(l); } else { this.menu.find("ul #" + before).before(l); } }, - getLink: function (name, href, id, help, className, icon) { + getLink: function (name, href, id, title, help, className, icon) { if (icon == undefined) { icon = true; } @@ -107,9 +107,8 @@ FluidbookNav.prototype = { res += getSpriteIcon(name); } - // Temporary: use the help text as the link text - we probably need a dedicated string for these if (help != undefined && help != '') { - res += ' ' + this.fluidbook.l10n.__(help); + res += ' ' + this.fluidbook.l10n.__(title); } // If there's no link defined, return the text an icon wrapped in a (useful for MMenu) @@ -170,7 +169,7 @@ FluidbookNav.prototype = { } try { if (homeURL != '') { - this.addLink('nav-home', homeURL, 'home', 'home'); + this.addLink('nav-home', homeURL, 'home', 'home', 'home'); } } catch (err) { @@ -185,14 +184,14 @@ FluidbookNav.prototype = { return false; }) } else if (icon == 'index') { - this.addLink('interface-index', '#/index', 'index', 'overview'); + this.addLink('interface-index', '#/index', 'index', 'overview', 'overview'); } else if (icon == 'chapters') { if (this.fluidbook.datas.displayChaptersIcon) { if (this.fluidbook.datas.chaptersPage != '') { - this.addLink('interface-chapters', '#/page/' + this.fluidbook.datas.chaptersPage, 'chapters', 'chapters'); + this.addLink('interface-chapters', '#/page/' + this.fluidbook.datas.chaptersPage, 'chapters', 'chapters', 'chapters'); } else if (this.fluidbook.datas.chapters.length > 0) { // this.addLink('nav-sommaire', '#/chapters', 'chapters', 'chapters'); - this.addLink('interface-chapters', '', 'chapters', 'chapters'); + this.addLink('interface-chapters', '', 'chapters', 'chapters', 'chapters'); // Get HTML for submenus (appended later) this.chaptersMenuHTML = this.makeChapterLists(this.fluidbook.datas.chapters); @@ -249,7 +248,7 @@ FluidbookNav.prototype = { } else if (icon == 'bookmark') { if (this.fluidbook.datas.bookmark) { - this.addLink('interface-bookmarks', '#/bookmark', 'bookmarks', 'bookmarks'); + this.addLink('interface-bookmarks', '#/bookmark', 'bookmarks', 'bookmarks', 'bookmarks'); $("#bookmarks").click(function () { if (!$this.fluidbook.bookmarks.hasBookmarkedPages()) { var message = $this.fluidbook.l10n.__("you don't have any bookmarks"); @@ -265,7 +264,8 @@ FluidbookNav.prototype = { } } else if (icon == 'pdf' || icon == 'print') { if ($("#print").length == 0 && (this.fluidbook.datas.print || this.fluidbook.datas.pdf)) { - this.addLink('interface-print', '#', 'print', '!' + this.fluidbook.l10n.__('print') + ' | ' + this.fluidbook.l10n.__('download pdf')); + var printOrDownload = '!' + this.fluidbook.l10n.__('print') + ' | ' + this.fluidbook.l10n.__('download pdf'); + this.addLink('interface-print', '#', 'print', printOrDownload, printOrDownload); $("#print").on('click', function () { $this.fluidbook.print(); return false; @@ -277,15 +277,15 @@ FluidbookNav.prototype = { } } else if (icon == 'archives') { if (this.fluidbook.datas.archivesLink != '') { - this.addLink('nav-archives', this.fluidbook.datas.archivesLink, 'archives', '!' + this.fluidbook.datas.archivesLabel); + this.addLink('nav-archives', this.fluidbook.datas.archivesLink, 'archives', '!' + this.fluidbook.datas.archivesLabel, '!' + this.fluidbook.datas.archivesLabel); } else if (this.fluidbook.datas.externalArchives != '') { - this.addLink('nav-archives', '#/archives', 'archives', '!' + this.fluidbook.datas.archivesLabel); + this.addLink('nav-archives', '#/archives', 'archives', '!' + this.fluidbook.datas.archivesLabel, '!' + this.fluidbook.datas.archivesLabel); } } else if (icon == 'help') { - this.addLink('interface-help', '#', 'help', 'help'); + this.addLink('interface-help', '#', 'help', 'help', 'help'); } else if (icon == 'zoom' && !this.fluidbook.support.isMobile) { - this.addLink('nav-zoomin', '#', 'zoomin', 'zoom in'); - this.addLink('nav-zoomout', '#', 'zoomout', 'zoom out'); + this.addLink('nav-zoomin', '#', 'zoomin', 'zoom in', 'zoom in'); + this.addLink('nav-zoomout', '#', 'zoomout', 'zoom out', 'zoom out'); $("#zoomin").click(function (e) { $this.fluidbook.desktop.clickZoom(e, 'in'); @@ -297,7 +297,7 @@ FluidbookNav.prototype = { return false; }); } else if (icon == 'fullscreen' && Modernizr.fullscreen && !DATAS.phonegap) { - this.addLink('interface-fullscreen', '#', 'fullscreen', 'switch between fullscreen and normal'); + this.addLink('interface-fullscreen', '#', 'fullscreen', 'Full screen', 'switch between fullscreen and normal'); $("#fullscreen").click(function () { $this.menuAPI.close(); screenfull.toggle(); @@ -547,8 +547,8 @@ FluidbookNav.prototype = { }, setInterface: function () { - var res = this.getLink('interface-previous', '#', 'previous', '', '', false); - res += this.getLink('interface-next', '#', 'next', '', '', false); + var res = this.getLink('interface-previous', '#', 'previous', '', '', '', false); + res += this.getLink('interface-next', '#', 'next', '', '', '', false); $('#interface').append(res); $(document).on('click', '#next', goNextPage); $(document).on('click', '#previous', goPreviousPage); diff --git a/plugins/com/promotal/catalogue/plugin.js b/plugins/com/promotal/catalogue/plugin.js index f3399da8..27865581 100644 --- a/plugins/com/promotal/catalogue/plugin.js +++ b/plugins/com/promotal/catalogue/plugin.js @@ -15,7 +15,7 @@ function com_promotal_catalogue() { data = JSON.parse(data); } distributeurs = data; - fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'help'); + fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'find a distributor', 'help'); }, error: getDistributeursFromCache }); @@ -28,7 +28,7 @@ function com_promotal_catalogue() { fluidbook.cache.set('promotions_' + locale, data); promotions = data; if (promotions.length > 0) { - fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'help'); + fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'promotions', 'help'); } }, error: getPromotionsFromCache @@ -45,7 +45,7 @@ function getDistributeursFromCache() { var locale = fluidbook.l10n.getActiveLang(); if (fluidbook.cache.isset('distributeurs_' + locale)) { distributeurs = fluidbook.cache.get('distributeurs_' + locale); - fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'help'); + fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'find a distributor', 'help'); } } @@ -55,7 +55,7 @@ function getPromotionsFromCache() { if (fluidbook.cache.isset('promotions_' + locale)) { promotions = fluidbook.cache.get('promotions_' + locale); if (promotions.length > 0) { - fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'help'); + fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'promotions', 'help'); } } } -- 2.39.5