2 * This file is part of WolneLektury-Mobile, licensed under GNU Affero GPLv3 or later.
3 * Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 var Links = new function() {
9 self.href = function(view, par) {
13 self.button = function(view, par, text, offset) {
15 var html = "<div class='button button-"+view+"' onclick='History.visit(\"" +
16 self.href(view, par).replace(/["']/g, "\\$&") + "\", "+offset+");'>";
18 if (icon != 'Book' && icon != 'Bookmarks' && icon != 'BookText' &&
19 icon != 'Last' && icon != 'Tag') {
22 html += "<img src='img/icon-" + icon + ".png' />";
23 html += "<div class='label'>" + text + "</div>";
24 html += "<div class='clr'></div>";
29 self.bookLink = function(book) {
34 // this assumes that either book has a html XOR it has children
36 note = "<div class='note'>";
40 note += book.pretty_size;
45 return self.button(target, book.id,
46 "<div class='sub'>" + book.authors + "</div>" +
50 self.deleteButton = function(id) {
51 return "<div class='delete' onClick='History.deleteBookmark(\""+id+"\");'>x</div>";