// }
// 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 = '<li>' + this.getLink(name, href, id, help, c) + '</li>';
+ var l = '<li>' + this.getLink(name, href, id, title, help, c) + '</li>';
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;
}
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 <span> (useful for MMenu)
}
try {
if (homeURL != '') {
- this.addLink('nav-home', homeURL, 'home', 'home');
+ this.addLink('nav-home', homeURL, 'home', 'home', 'home');
}
} catch (err) {
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);
} 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");
}
} 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;
}
} 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');
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();
},
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);
data = JSON.parse(data);\r
}\r
distributeurs = data;\r
- fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'help');\r
+ fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'find a distributor', 'help');\r
},\r
error: getDistributeursFromCache\r
});\r
fluidbook.cache.set('promotions_' + locale, data);\r
promotions = data;\r
if (promotions.length > 0) {\r
- fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'help');\r
+ fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'promotions', 'help');\r
}\r
},\r
error: getPromotionsFromCache\r
var locale = fluidbook.l10n.getActiveLang();\r
if (fluidbook.cache.isset('distributeurs_' + locale)) {\r
distributeurs = fluidbook.cache.get('distributeurs_' + locale);\r
- fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'help');\r
+ fluidbook.nav.addLink('nav-map', '#/distributors', 'map', 'find a distributor', 'find a distributor', 'help');\r
}\r
}\r
\r
if (fluidbook.cache.isset('promotions_' + locale)) {\r
promotions = fluidbook.cache.get('promotions_' + locale);\r
if (promotions.length > 0) {\r
- fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'help');\r
+ fluidbook.nav.addLink('nav-tag', '#/promotions', 'tag', 'promotions', 'promotions', 'help');\r
}\r
}\r
}\r