$(document).on('click', '.bookmarkssub a.send', function () {
var subject = '%title%';
- if ($this.fluidbook.datas.bookmark_email_title != '') {
+ if ($this.fluidbook.datas.bookmark_email_title !== '') {
subject = $this.fluidbook.datas.bookmark_email_title;
}
var body = $this.fluidbook.l10n.__('Please see the attached files from "%title%".');
- if ($this.fluidbook.datas.bookmark_email_body != '') {
+ if ($this.fluidbook.datas.bookmark_email_body !== '') {
body = $this.fluidbook.datas.bookmark_email_body;
}
if (b > this.fluidbook.contentlock.getMaxPage()) {
continue;
}
- if (rs == 0) {
+ if (rs === 0) {
rs = re = b;
continue;
}
- if (re + 1 == b) {
+ if (re + 1 === b) {
re = b;
continue;
}
- if (rs == re) {
+ if (rs === re) {
g.push('' + rs);
} else {
g.push(rs + '-' + re);
rs = re = b;
}
- if (rs != 0) {
- if (rs == re) {
+ if (rs !== 0) {
+ if (rs === re) {
g.push('' + rs);
} else {
g.push(rs + '-' + re);
},
completeGroups: function () {
for (var i = 1; i <= this.fluidbook.datas.pages; i++) {
- if (this._pagesToGroup[i] == undefined || this._pagesToGroup[i] == null) {
+ if (this._pagesToGroup[i] === undefined || this._pagesToGroup[i] === null) {
this._pagesToGroup[i] = this._groups;
this._groupOrder.push(this._groups);
this._groups++;
},
getPreviousGroup: function (group) {
var o = this.getOrderGroup(group);
- if (o == -1) {
+ if (o === -1) {
return false;
}
o--;
},
getNextGroup: function (group) {
var o = this.getOrderGroup(group);
- if (o == -1) {
+ if (o === -1) {
return false;
}
o++;
},
getGroupName: function (groupId) {
var res = '';
- if (this._groupNames[groupId] != undefined) {
+ if (this._groupNames[groupId] !== undefined) {
res = this._groupNames[groupId];
}
- if (res == '') {
+ if (res === '') {
var pages = this.getPagesOfGroup(groupId);
res = this.fluidbook.physicalToVirtual(pages[0]);
- if (pages.length == 1) {
+ if (pages.length === 1) {
return res;
}
res += " - " + this.fluidbook.physicalToVirtual(pages[pages.length - 1]);
return this.getPagesOfGroup(groupId).length;
},
getBookmarkedGroups: function (onlyBookmarked) {
- if (onlyBookmarked == undefined) {
+ if (onlyBookmarked === undefined) {
onlyBookmarked = true;
}
getNextPageInGroupOfPage: function (page) {
var group = this.getLinkedPages(page);
var index = group.indexOf(page);
- if (index == group.length - 1) {
+ if (index === group.length - 1) {
return false;
}
return group[index + 1];
getPreviousPageInGroupOfPage: function (page) {
var group = this.getLinkedPages(page);
var index = group.indexOf(page);
- if (index == 0) {
+ if (index === 0) {
return false;
}
return group[index - 1];
var group = this.getGroupOfPage(page);
var pages = this.getPagesOfGroup(group);
var i = pages.indexOf(page);
- if (i == pages.length - 1) {
+ if (i === pages.length - 1) {
return false;
}
return true;
return this.getPagesOfGroup(group);
},
addBookmark: function (page, cornersOnly) {
- if (cornersOnly == undefined) {
+ if (cornersOnly === undefined) {
cornersOnly = false;
}
var pages = this.getLinkedPages(page);
+ var page;
for (i in pages) {
- var page = pages[i];
+ page = pages[i];
if (!cornersOnly) {
this.bookmarks.push(page);
return this.bookmarks.indexOf(page) > -1;
},
getBookmarkForPage: function (pageNr, onlyOne, allwaysAtRight) {
- if (onlyOne == undefined) {
+ if (onlyOne === undefined) {
onlyOne = false;
}
- if (allwaysAtRight == undefined) {
+ if (allwaysAtRight === undefined) {
allwaysAtRight = false;
}
to++;
}
+ console.log('getBookmarkForPage',pageNr);
+
var bookmarks = "";
for (var i = pageNr; i <= to; i++) {
if (i > 0 && i <= this.fluidbook.contentlock.getMaxPage()) {
if (allwaysAtRight) {
side = 'right';
} else {
- side = (i % 2 == 0) ? 'left' : 'right';
- if (this.fluidbook.l10n.dir == 'rtl') {
- side = side == 'left' ? 'right' : 'left';
+ side = (i % 2 === 0) ? 'left' : 'right';
+ if (this.fluidbook.l10n.dir === 'rtl') {
+ side = side === 'left' ? 'right' : 'left';
}
}
if (c === false) {
return c;
}
- if (title == '') {
+ if (title === '') {
title = this.fluidbook.l10n.__('bookmarks');
}
var index = '<div class="bookmarkssub"><div class="caption">' + this.fluidbook.menu.closeButton() + '<h2>' + title + '</h2>';
return index;
},
hasBookmarkedPages: function (all) {
- if (all == undefined) {
+ if (all === undefined) {
all = false;
}
- if (all == false) {
+ if (all === false) {
groups = this.getBookmarkedGroups();
} else {
groups = this.getOrderedGroups();
}
- if (groups.length == 0) {
+ if (groups.length === 0) {
return false;
}
return true;
},
getIndex: function (all, onlyGroup, downloadLabel) {
- if (all == undefined) {
+ if (all === undefined) {
all = false;
}
var groups;
- if (all == false) {
+ if (all === false) {
groups = this.getBookmarkedGroups();
} else {
groups = this.getOrderedGroups();
}
- if (groups.length == 0) {
+ if (groups.length === 0) {
return false;
}
- if (downloadLabel == '') {
+ if (downloadLabel === '') {
downloadLabel = this.fluidbook.l10n.__('download');
}
var index = '<div class="content"><div id="indexView" class="bookmarkView">';
- if (onlyGroup == undefined || !onlyGroup) {
+ if (onlyGroup === undefined || !onlyGroup) {
for (var g = 0; g < groups.length; g++) {
var group = groups[g];
var pages = [];