var p_a = this.getPagesOfGroup(a)[0];
var p_b = this.getPagesOfGroup(b)[0];
return p_a - p_b;
- },
- sortnumeric: function (a, b) {
+ }, sortnumeric: function (a, b) {
return a - b;
- },
- openPDF: function (element, print) {
+ }, openPDF: function (element, print) {
print = print || false;
this.fluidbook._openFile(this.getPDF(), element, 'pdf', this.getBookmarksCompacted() + '.pdf', print);
- },
- getPDF: function () {
+ }, getPDF: function () {
return 'https://workshop.fluidbook.com/s/e/' + this.fluidbook.settings.cid + '/' + this.getBookmarksCompacted();
- },
- getBookmarksCompacted: function () {
+ }, getBookmarksCompacted: function () {
this.bookmarks.sort(this.sortnumeric);
}
return g.join(',');
- },
- addGroup: function (from, nb, name) {
+ }, addGroup: function (from, nb, name) {
var to = Math.min(from + (nb - 1), this.fluidbook.settings.pages);
for (var i = from; i <= to; i++) {
this._pagesToGroup[i] = this._groups;
this._groupNames[this._groups] = name;
this._groupOrder.push(this._groups);
this._groups++;
- },
- completeGroups: function () {
+ }, completeGroups: function () {
for (var i = 1; i <= this.fluidbook.settings.pages; i++) {
if (this._pagesToGroup[i] === undefined || this._pagesToGroup[i] === null) {
this._pagesToGroup[i] = this._groups;
this._groups++;
}
}
- },
- getPreviousGroup: function (group) {
+ }, getPreviousGroup: function (group) {
var o = this.getOrderGroup(group);
if (o === -1) {
return false;
}
o--;
return this._groupOrder[o];
- },
- getNextGroup: function (group) {
+ }, getNextGroup: function (group) {
var o = this.getOrderGroup(group);
if (o === -1) {
return false;
}
o++;
return this._groupOrder[o];
- },
- getOrderGroup: function (group) {
+ }, getOrderGroup: function (group) {
return this._groupOrder.indexOf(group);
- },
- getGroupName: function (groupId) {
+ }, getGroupName: function (groupId) {
var res = '';
if (this._groupNames[groupId] !== undefined) {
res = this._groupNames[groupId];
res += " - " + this.fluidbook.physicalToVirtual(pages[pages.length - 1]);
}
return res;
- },
- getPagesOfGroup: function (groupId) {
+ }, getPagesOfGroup: function (groupId) {
var res = [];
for (var i = 1; i <= this.fluidbook.settings.pages; i++) {
if (this._pagesToGroup[i] === groupId) {
}
}
return res;
- },
- getPagesNumberInGroup: function (groupId) {
+ }, getPagesNumberInGroup: function (groupId) {
return this.getPagesOfGroup(groupId).length;
- },
- getBookmarkedGroups: function (onlyBookmarked) {
+ }, getBookmarkedGroups: function (onlyBookmarked) {
if (onlyBookmarked === undefined) {
onlyBookmarked = true;
}
i++;
}
return res;
- },
- getOrderedGroups: function () {
+ }, getOrderedGroups: function () {
return this.getBookmarkedGroups(false);
- },
- getGroupOfPage: function (page) {
+ }, getGroupOfPage: function (page) {
return this._pagesToGroup[page];
- },
- getNextPageInGroupOfPage: function (page) {
+ }, getNextPageInGroupOfPage: function (page) {
var group = this.getLinkedPages(page);
var index = group.indexOf(page);
if (index === group.length - 1) {
return false;
}
return group[index + 1];
- },
- getPreviousPageInGroupOfPage: function (page) {
+ }, getPreviousPageInGroupOfPage: function (page) {
var group = this.getLinkedPages(page);
var index = group.indexOf(page);
if (index === 0) {
return false;
}
return group[index - 1];
- },
- getNextGroupCover: function (page) {
+ }, getNextGroupCover: function (page) {
var group = this.getGroupOfPage(page);
group = this.getNextGroup(group);
if (group === false) {
return false;
}
return this.getCoverOfGroup(group);
- },
- getPreviousGroupCover: function (page) {
+ }, getPreviousGroupCover: function (page) {
var group = this.getGroupOfPage(page);
group = this.getPreviousGroup(group);
if (group === false) {
return false;
}
return this.getCoverOfGroup(group);
- },
- getCoverOfGroup: function (group) {
+ }, getCoverOfGroup: function (group) {
var pages = this.getPagesOfGroup(group);
if (pages.length) {
return pages[0];
}
return false;
- },
- hasNextPageInGroup: function (page) {
+ }, hasNextPageInGroup: function (page) {
var group = this.getGroupOfPage(page);
var pages = this.getPagesOfGroup(group);
var i = pages.indexOf(page);
return false;
}
return true;
- },
- getLinkedPages: function (page) {
+ }, getLinkedPages: function (page) {
var group = this.getGroupOfPage(page);
if (group === -1 || isNaN(group)) {
return [];
}
return this.getPagesOfGroup(group);
- },
- addBookmark: function (page, cornersOnly) {
+ }, addBookmark: function (page, cornersOnly) {
if (!this.areBookmarksAllowedOn(page)) {
return;
}
this.fluidbook.stats.track(4, pages[0]);
}
}
- },
- setCornersEnabled: function (page, enabled) {
+ }, setCornersEnabled: function (page, enabled) {
var bookmarks = $('.bookmark[data-page="' + page + '"]');
if (enabled) {
$(bookmarks).attr('data-enabled', 'enabled').attr('data-tooltip', this._txtRemove);
} else {
$(bookmarks).attr('data-enabled', null).attr('data-tooltip', this._txtAdd);
}
- },
- disableCorners: function () {
+ }, disableCorners: function () {
$(".bookmark").attr('data-enabled', null).attr('data-tooltip', this._txtAdd);
- },
- toggleBookmark: function (page) {
+ }, toggleBookmark: function (page) {
if (!this.areBookmarksAllowedOn(page)) {
return;
}
} else {
this.addBookmark(page);
}
- },
- removeBookmark: function (page) {
+ }, removeBookmark: function (page) {
var pages = this.getLinkedPages(page);
for (var i in pages) {
this.bookmarks = arrayRemove(this.bookmarks, pages[i]);
}
this.updateBookmarks();
- },
- updateBookmarks: function () {
+ }, updateBookmarks: function () {
this.saveBookmarks();
var $this = this;
$.each(this.bookmarks, function (k, v) {
$this.setCornersEnabled(v, true);
});
- },
- saveBookmarks: function () {
+ }, saveBookmarks: function () {
this.fluidbook.cache.set('bookmarks', this.bookmarks);
- },
- getSavedBookmarks: function () {
+ }, getSavedBookmarks: function () {
if (this.fluidbook.cache.isset('bookmarks')) {
return this.fluidbook.cache.get('bookmarks');
}
return [];
- },
- isBookmarked: function (page) {
+ }, isBookmarked: function (page) {
return this.areBookmarksAllowedOn(page) && this.bookmarks.indexOf(page) > -1;
- },
- areBookmarksAllowedOn: function (pageNr) {
+ }, areBookmarksAllowedOn: function (pageNr) {
if (pageNr === 0 || pageNr > this.fluidbook.settings.pages) {
return false;
}
return this.fluidbook.settings.bookmarkDisablePages.indexOf(pageNr) === -1;
- },
- getBookmarkForPage: function (pageNr, allwaysAtRight, permanentIcon) {
+ }, getBookmarkForPage: function (pageNr, allwaysAtRight, permanentIcon) {
if (!this.areBookmarksAllowedOn(pageNr)) {
return '';
}
bookmarks += '>' + getSpriteIcon('bookmark-corner') + '</a>';
return bookmarks;
- },
- getView: function (title, downloadLabel) {
+ }, getView: function (title, downloadLabel) {
var c = this.getIndex(false, false, downloadLabel);
if (c === false) {
return c;
index += c;
index += '</div>';
return index;
- },
- hasBookmarkedPages: function (all) {
+ }, hasBookmarkedPages: function (all) {
if (all === undefined) {
all = false;
}
return false;
}
return true;
- },
- getIndex: function (all, onlyGroup, downloadLabel) {
+ }, getIndex: function (all, onlyGroup, downloadLabel) {
if (all === undefined) {
all = false;
}
contentClass += ' noscroll mobilefirst';
}
- var index = '<div class="' + contentClass + '"><div class="indexView bookmarkView"><div class="indexViewHolder">';
- if (onlyGroup === undefined || !onlyGroup) {
- for (var g = 0; g < groups.length; g++) {
- var group = groups[g];
- var pages = [];
- for (var i = 0; i < group.nb; i++) {
- pages.push(group.page + i);
- }
+ var index = '<div class="' + contentClass + '"><div class="indexView bookmarkView" data-size="' + this.fluidbook.settings.bookmarkView + '">';
+
+ if (this.fluidbook.settings.bookmarkView === 'small') {
+ index += '<div class="indexViewHolder">';
+ if (onlyGroup === undefined || !onlyGroup) {
+ for (var g = 0; g < groups.length; g++) {
+ var group = groups[g];
+ var pages = [];
+ for (var i = 0; i < group.nb; i++) {
+ pages.push(group.page + i);
+ }
- var dim = this.fluidbook.menu.index.getThumbDimensions(group.page);
+ var dim = this.fluidbook.menu.index.getThumbDimensions(group.page);
- index += '<div class="doubleThumb simple left"' + dim.doublethumb + ' page="' + group.page + '" data-pages="' + pages.join(',') + '">';
- index += this.fluidbook.menu.index._thumb(group.page, 'left', this.fluidbook.mobilefirst.enabled?undefined:100, group.name);
- if (this.fluidbook.bookmarks.enabled) {
- index += this.fluidbook.bookmarks.getBookmarkForPage(group.page, true, true);
+ index += '<div class="doubleThumb simple left"' + dim.doublethumb + ' page="' + group.page + '" data-pages="' + pages.join(',') + '">';
+ index += this.fluidbook.menu.index._thumb(group.page, 'left', this.fluidbook.mobilefirst.enabled ? undefined : 100, group.name);
+ if (this.fluidbook.bookmarks.enabled) {
+ index += this.fluidbook.bookmarks.getBookmarkForPage(group.page, true, true);
+ }
+ index += '</div>';
+ index += '</div>';
}
- index += '</div>';
- index += '</div>';
- }
- } else {
- var group = groups[this.getGroupOfPage(onlyGroup)];
+ } else {
+ var group = groups[this.getGroupOfPage(onlyGroup)];
- var pages = [];
- for (var i = 0; i < group.nb; i++) {
- pages.push(group.page + i);
- }
+ var pages = [];
+ for (var i = 0; i < group.nb; i++) {
+ pages.push(group.page + i);
+ }
- for (i in pages) {
- var p = pages[i];
+ for (i in pages) {
+ var p = pages[i];
- var dim = this.fluidbook.menu.index.getThumbDimensions(p);
+ var dim = this.fluidbook.menu.index.getThumbDimensions(p);
- index += '<div class="doubleThumb simple left"' + dim.doublethumb + ' page="' + p + '" data-pages="' + p + '">';
- index += this.fluidbook.menu.index._thumb(p, 'left', this.fluidbook.mobilefirst.enabled?undefined:100);
- if (this.fluidbook.bookmarks.enabled) {
- index += this.fluidbook.bookmarks.getBookmarkForPage(p, true, true);
+ index += '<div class="doubleThumb simple left"' + dim.doublethumb + ' page="' + p + '" data-pages="' + p + '">';
+ index += this.fluidbook.menu.index._thumb(p, 'left', this.fluidbook.mobilefirst.enabled ? undefined : 100);
+ if (this.fluidbook.bookmarks.enabled) {
+ index += this.fluidbook.bookmarks.getBookmarkForPage(p, true, true);
+ }
+ index += '</div>';
+ index += '</div>';
}
- index += '</div>';
- index += '</div>';
}
+ index += '</div>';
+ } else if (this.fluidbook.settings.bookmarkView === 'large') {
+ index += this.fluidbook.menu.index.getPages();
}
- index += '</div></div>';
+ index += '</div>';
index += '<div class="fonctions">';
if (this.fluidbook.settings.friend && this.fluidbook.settings.bookmarkSendEnable) {
index += '<a role="button" aria-label="' + this.fluidbook.l10n.__('send') + '" class="send" href="#">' + this.fluidbook.l10n.__('send') + '</a>';
var maxImages = 3, // How many images maximum to show in the bookmarks print preview thumbnail
- count = 0,
- html = '',
- groups = this.getBookmarkedGroups();
+ count = 0, html = '', groups = this.getBookmarkedGroups();
html += '<div class="bookmark-thumbnails">';
viewMode: function () {
return $("#view .mview").length > 0;
- },
- openView: function (view, param1, param2, callback) {
+ }, openView: function (view, param1, param2, callback) {
var $this = this;
setTimeout(function () {
_openView: function (view, param1, param2, callback) {
var $this = this;
var preload = {
- index: 'thumbnails',
- search: 'thumbnails',
- bookmark: 'thumbnails',
- video: 'extras'
+ index: 'thumbnails', search: 'thumbnails', bookmark: 'thumbnails', video: 'extras'
};
if (!OFFLINEAPP && this.fluidbook.gal != null && preload[view] !== undefined) {
this.fluidbook.displayLoader();
} else {
this.__openView(view, param1, param2, callback);
}
- },
- __openView: function (view, param1, param2, callback) {
+ }, __openView: function (view, param1, param2, callback) {
try {
if (typeof param1 === 'string') {
} else {
this['open' + camelView](param1, param2, cb);
}
- },
- openNotes: function (p1, p2, cb) {
+ }, openNotes: function (p1, p2, cb) {
this.fluidbook.notes.openMenu(cb);
- },
- openSearch: function (q, cb) {
+ }, openSearch: function (q, cb) {
this.fluidbook.nav.openSearch(q, cb);
- },
- openingView: function (callback, view) {
+ }, openingView: function (callback, view) {
var $this = this;
this.fluidbook.resize.resizeView();
this.fluidbook.tooltip.hideTooltip();
c = ' ' + c;
}
return '<a href="#/closeview" role="button" aria-label="' + this.fluidbook.l10n.__('close') + '" aria-keyshortcuts="Escape" class="button back' + c + '">' + getSpriteIcon('interface-close') + '</a>';
- },
- openAudio: function (audio, callback) {
+ }, openAudio: function (audio, callback) {
var hash = '#/audio/' + audio;
var a = $('a[href="' + hash + '"]');
var markup = decodeURIComponent($(a).attr('data-audio'));
if (callback != undefined) {
callback();
}
- },
- openWebVideo: function (service, video, callback) {
+ }, openWebVideo: function (service, video, callback) {
var hash = '#/webvideo/' + service + '/' + video;
var a = $('a[href="' + hash + '"]');
var markup = decodeURIComponent($(a).attr('data-video'));
if (callback != undefined) {
callback();
}
- },
- openLocales: function (p1, p2, callback) {
+ }, openLocales: function (p1, p2, callback) {
var view = this.getCaption('Select language');
view += '<div class="content">';
view += '<ul class="chapters localesList">';
openCart: function (p1, p2, callback) {
this.fluidbook.cart.instance.openMenu(p1, p2, callback);
- },
- openShare: function (p1, p2, callback) {
+ }, openShare: function (p1, p2, callback) {
this.fluidbook.share.openShare(p1, p2, callback);
},
if (callback !== undefined) {
callback();
}
- },
- openChapters: function (submenu, callback) {
+ }, openChapters: function (submenu, callback) {
if (this.fluidbook.settings.externalChaptersHTML != '') {
this.openExternalChapters(callback);
return;
callback();
}
this.fluidbook.stats.track(14);
- },
- openExternalChapters: function (callback) {
+ }, openExternalChapters: function (callback) {
var view = this.getCaption();
view += '<div class="content"><div class="multimediaHolder"><div class="multimediaScale">';
view += '<iframe data-width="' + this.fluidbook.settings.externalChaptersSize.width + '" data-height="' + this.fluidbook.settings.externalChaptersSize.height + '" width="' + this.fluidbook.settings.externalChaptersSize.width + '" height="' + this.fluidbook.settings.externalChaptersSize.height + '" src="data/chapters/index.html" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
callback();
}
this.fluidbook.stats.track(14);
- },
- openIndex: function (title, group, closeAll, callback) {
+ }, openIndex: function (title, group, closeAll, callback) {
this.index.openIndex(title, group, closeAll, callback);
- },
- openArchives: function (title, callback) {
+ }, openArchives: function (title, callback) {
var archives = this.getCaption(title, true, title === undefined || title === '' ? 'h0' : '');
archives += '<div class="content"><div class="image" id="archivesview"><img src="data/images/' + this.fluidbook.settings.externalArchives + '" /><div class="links">' + this.fluidbook.loader.handleExtension(this.fluidbook.settings.links.archives) + '</div></div></div>';
this.viewWrap(archives, 'archives', '', 'archives');
if (callback != undefined) {
callback();
}
- },
- openText: function (text, callback) {
+ }, openText: function (text, callback) {
var styleMatches = text.match(/\<style\>([^\<]*)<\/style>/);
var style = '';
} else {
this._closeView(callback, all, animate);
}
- },
- _closeView: function (callback, all, animate) {
+ }, _closeView: function (callback, all, animate) {
var $this = this;
if (all == undefined) {
all = false;
}, 200);
break;
case 'bookmarks':
- if (this.fluidbook.mobilefirst.enabled) {
+ if (this.fluidbook.settings.bookmarkView === 'large') {
+ fullscreen = true;
+ } else if (this.fluidbook.mobilefirst.enabled) {
var indexWidth = Math.floor(ww / 230) * 230;
$(".indexViewHolder:visible").css('width', indexWidth);
var cw = 30 + 10 + 130 * this.fluidbook.bookmarks.getBookmarkedGroups(true).length;
if (s < 1) {
var css = {
- overflow: 'hidden',
- width: nw * s,
- height: nh * s,
- top: y,
- left: x,
- position: 'absolute'
+ 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: ''
+ position: "", overflow: '', width: '', height: '', top: '', left: ''
});
}
m.find('.multimediaScale').css({width: nw, height: nh, overflow: 'hidden'}).transform({
- scale: [s, s],
- origin: [0, 0]
+ scale: [s, s], origin: [0, 0]
}).css('text-align', 'left');
break;
case 'slideshow':
}
var captionHeight = 0;
- m.find('.caption, .fixed').each(function () {
+ m.find('.caption, .fixed, .fonctions').each(function () {
captionHeight += $(this).outerHeight();
- })
+ });
w = Math.min(maxWidth, w);
$("#popinOverlay>div").each(function () {
$(this).css({
- top: (hh - $(this).outerHeight()) / 2,
- left: (ww - $(this).outerWidth()) / 2
+ top: (hh - $(this).outerHeight()) / 2, left: (ww - $(this).outerWidth()) / 2
});
});
var w = $(window).width() - 200;
var h = 30;
$(this).css({
- height: h,
- width: w,
- display: 'block',
- margin: '40px auto'
+ height: h, width: w, display: 'block', margin: '40px auto'
});
});
},