about summary refs log tree commit diff stats
path: root/offline.html
diff options
context:
space:
mode:
authorAndrew Dolgov <noreply@fakecake.org>2017-02-27 23:30:12 +0300
committerAndrew Dolgov <noreply@fakecake.org>2017-02-27 23:30:12 +0300
commit16d52ac49f7318620d3a84e172cf18917d70de1b (patch)
tree9a2e387a61d1e427a882557bc088ec6689fae7f9 /offline.html
parentc47556b617f0a351faeef53cd1aec67bf49229f1 (diff)
downloadthe-epube-16d52ac49f7318620d3a84e172cf18917d70de1b.tar.gz
the-epube-16d52ac49f7318620d3a84e172cf18917d70de1b.tar.xz
add basic offline mode search
Diffstat (limited to 'offline.html')
-rw-r--r--offline.html16
1 files changed, 13 insertions, 3 deletions
diff --git a/offline.html b/offline.html
index 8b25d21..0062518 100644
--- a/offline.html
+++ b/offline.html
@@ -42,7 +42,13 @@
 		</ul>
 
 		<form onsubmit="return false;" class="navbar-form navbar-right">
-			<button type="submit" onclick="offline_clear()" class="btn btn-default">Remove all</button>
+			<button type="submit" onclick="offline_clear()" class="btn btn-danger">Remove all</button>
+		</form>
+
+		<form onsubmit="return offline_search(this)" class="navbar-form navbar-right">
+			<input type="text" class="form-control search_query" name="query" class="form-control"
+				value="">
+			<button type="submit" class="btn btn-default">Search</button>
 		</form>
 
 	</div>
@@ -59,10 +65,14 @@
            .then(function() {
 					console.log("service worker registered");
 				});
-
 		}
 
-		populate_list();
+		localforage.getItem("epube.search-query").then(function(query) {
+
+			if (query) $(".search_query").val(query);
+
+			populate_list();
+		});
 
 	});
 </script>