From 6ec52b5dda11acb8a6ea7bb06392ff67cb5ffba0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 26 Jul 2017 14:34:35 +0300 Subject: add a button to download all favs --- js/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'js') diff --git a/js/index.js b/js/index.js index 28e1227..2ec26f3 100644 --- a/js/index.js +++ b/js/index.js @@ -197,3 +197,22 @@ function show_summary(elem) { return false; } + +function offline_get_all() { + + if (confirm("Download all books on this page?")) { + + $(".index_cell").each(function (i, row) { + var bookId = $(row).attr("id").replace("cell-", ""); + var dropitem = $(row).find(".offline_dropitem")[0]; + + if (bookId) { + offline_cache(bookId, function() { + mark_offline(dropitem); + }); + } + }); + } + +} + -- cgit v1.2.3