}
return bookmarks;
},
- getView: function () {
- var c = this.getIndex(false);
+ getView: function (title, downloadLabel) {
+ var c = this.getIndex(false, false, downloadLabel);
if (c === false) {
return c;
}
- var index = '<div class="bookmarkssub"><div class="caption">' + this.fluidbook.menu.closeButton() + '<h2>' + this.fluidbook.l10n.__('bookmarks') + '</h2>';
+ if(title==''){
+ title=this.fluidbook.l10n.__('bookmarks');
+ }
+ var index = '<div class="bookmarkssub"><div class="caption">' + this.fluidbook.menu.closeButton() + '<h2>' + title + '</h2>';
index += '</div>';
index += c;
index += '</div>';
}
return true;
},
- getIndex: function (all, onlyGroup) {
+ getIndex: function (all, onlyGroup, downloadLabel) {
if (all == undefined) {
all = false;
}
return false;
}
+ if (downloadLabel == '') {
+ downloadLabel = this.fluidbook.l10n.__('download');
+ }
+
var index = '<div class="content"><div id="indexView" class="bookmarkView">';
- if (onlyGroup == undefined) {
+ if (onlyGroup == undefined || !onlyGroup) {
for (var g = 0; g < groups.length; g++) {
var group = groups[g];
var pages = [];
}
if (this.fluidbook.datas.print || this.fluidbook.datas.pdf) {
- index += '<a class="print" href="#">' + this.fluidbook.l10n.__('download') + '</a>';
+ index += '<a class="print" href="#">' + downloadLabel + '</a>';
}
index += '</div>';
index += '</div>';
}
if (action == 'chapters' && extra) {
- window.location.hash='#/chapters/'+extra;
+ window.location.hash = '#/chapters/' + extra;
return false;
}
var navitem = $("#horizontalNav_" + action);
+
if (navitem.length > 0) {
+ if ($(this).data('extra') != null) {
+ $(navitem).data('extra', $(this).data('extra'));
+ }
$(navitem).get(0).click();
}
}
},
__openView: function (view, param1, param2, callback) {
- //console.log('__openView(' + view + ',' + param1 + ',' + param2 + ')');
- param1 = decodeURIComponent(param1);
- param2 = decodeURIComponent(param2);
+ if (typeof param1 === 'string') {
+ param1 = decodeURIComponent(param1);
+ }
+ if (typeof param2 === 'string') {
+ param2 = decodeURIComponent(param2);
+ }
var $this = this;
var camelView = view.charAt(0).toUpperCase() + view.substr(1);
this.fluidbook.share.openShare(p1, p2, callback);
},
openBookmark: function (p1, p2, callback) {
- var view = this.fluidbook.bookmarks.getView();
+ console.log('!!' + JSON.stringify(p1));
+ var title = '';
+ var downloadLabel = '';
+ try {
+ title = p1.title;
+ } catch (e) {
+
+ }
+ try {
+ downloadLabel = p1.downloadLabel;
+ } catch (e) {
+
+ }
+ if (title == undefined) {
+ title = '';
+ }
+ if (downloadLabel == undefined) {
+ downloadLabel = '';
+ }
+
+ var view = this.fluidbook.bookmarks.getView(title, downloadLabel);
if (view !== false) {
$("#view").append('<div class="mview" data-menu="bookmarks">' + view + '</div>');
if (callback != undefined) {
navOrder.push(navOrder.splice(localeIconIndex, 1)[0]); // Push to end of array
}
+ var hide = array_diff(all, navOrder);
+ var thisall = navOrder.concat(hide);
+
var $this = this;
- for (var i in navOrder) {
- var icon = navOrder[i];
- //var visible = hide.indexOf(icon) == -1;
+ for (var i in thisall) {
+ var icon = thisall[i];
+ var visible = hide.indexOf(icon) == -1;
+ if (!visible && navType == 'menu') {
+ continue;
+ }
var link = null;
var link2 = null;
link = $(link).get(0).outerHTML;
}
-
-
var nav = this.getNavFromType(navType);
nav.find('ul').append('<li>' + link + '</li>');
}
- // if (!visible) {
- // $(link).addClass('hidden');
- // }
+ if (!visible) {
+ $(link).addClass('hidden');
+ if (link2) {
+ $(link2).addClass('hidden');
+ }
+ }
}
if (navType == 'menu') {
// Share icon
$(document).on('click', '.icon-share', function () {
if ($this.fluidbook.datas.phonegap != 'android') {
- return true;
+ return true;0
}
$this.fluidbook.share.intentShare();
return false;
}
return false;
}
+ if ($(this).data('extra') != null) {
+ $this.fluidbook.menu.openView('bookmark', $(this).data('extra'), null, function () {
+ });
+ return false;
+ }
});
// Zoom In icon
.help & {
color: #ccc;
}
+ &.hidden {
+ display: none !important;
+ opacity: 0;
+ width: 0;
+ height: 0;
+ visibility: hidden;
+ margin: 0;
+ padding: 0;
+ }
}
img, .svg-icon {
height: 25px;
width: auto;
- .msie &{
+ .msie & {
width: 25px;
}