init: function (datas) {
this.datas = datas;
this.junk = datas.cacheDate;
- this.landingpage = new FluidbookLandingPage(this);
+ if (this.datas.landingPage != undefined && this.datas.landingPage != '') {
+ this.landingpage = new FluidbookLandingPage(this);
+ }
this.menu = new FluidbookMenu(this);
this.zoom = new FluidbookZoom(this);
this.zoom.resetZoom();
this.tooltip = new FluidbookTooltip(this);
this.audiodescription = new FluidbookAudioDescription(this);
this.sound = new FluidbookSound(this);
- this.cart =new FluidbookCart(this);
-
+ if(this.datas.basket) {
+ this.cart = new FluidbookCart(this);
+ }
if (this.datas.form == 'bulle') {
this.form = new FluidbookBulleForm(this);
} else {
var args = window.location.hash.split('/');
if (args.length <= 1 || args[1] == '' || args[1] == undefined) {
- if (this.landingpage.hasLandingPage) {
+ if (this.landingpage!==undefined && this.landingpage.hasLandingPage) {
window.location.hash = '/landing';
return;
}
if (page != $this.currentPage) {
$($this).trigger('changePage', [page]);
}
- this.landingpage.hide();
+ if(this.landingpage!==undefined) {
+ this.landingpage.hide();
+ }
this.menu.closeView(function () {
if (page != $this.currentPage) {
$this.pageTransition(page);
else if (args[1] == 'landing') {
$this.hideSplash();
- this.landingpage.show();
+ if(this.landingpage!==undefined) {
+ this.landingpage.show();
+ }
}
else {
link = this.addLink(navType, 'nav-download', '#', 'download', 'download', 'download');
} else if (icon == 'print' && this.fluidbook.datas.print) {
link = this.addLink(navType, 'nav-print', '#', 'print', 'print', 'print');
- } else if (icon == 'basket' && this.fluidbook.cart.enabled) {
+ } else if (icon == 'basket' && this.fluidbook.cart != undefined && this.fluidbook.cart.enabled) {
link = this.addLink(navType, 'nav-basket', '#/cart', 'cart', 'basket', 'basket');
$(this.fluidbook).on('fluidbook.cart.updateIcon', {link: $(link).attr('id')}, function (e, data) {
var n = data.number;
$(l).find('span.number').text(n);
}
});
- this.fluidbook.cart.instance.updateIcon();
+ this.fluidbook.cart.instance.updateIcon();
} else if (icon == 'lang' && this.fluidbook.l10n.multilangEnabled) {
// Note: the "!" at the beginning of the title/help parameters means that we don't want these strings translated
link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language');