X-Git-Url: https://git.mdrn.pl/wl-mobile.git/blobdiff_plain/d947c00d92691df552a793f8d9c2991c931ad244..47c6f3ce00bf63377aa1f4f4332039534ff7d7ee:/assets/www/js/links.js diff --git a/assets/www/js/links.js b/assets/www/js/links.js new file mode 100644 index 0000000..3a7465a --- /dev/null +++ b/assets/www/js/links.js @@ -0,0 +1,53 @@ +/* + * This file is part of WolneLektury-Mobile, licensed under GNU Affero GPLv3 or later. + * Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. + */ + +var Links = new function() { + var self = this; + + self.href = function(view, par) { + return view+"/"+par; + }; + + self.button = function(view, par, text, offset) { + offset = offset || 0; + var html = "
\n"; + return html; + }; + + self.bookLink = function(book) { + var target = 'Book'; + var note = ''; + + if (book.html_file) { + // this assumes that either book has a html XOR it has children + target = 'BookText'; + note = "