Browse Source

simplify toolbar buttons

Andrew Dolgov 2 months ago
parent
commit
7d6dabec3b
3 changed files with 38 additions and 27 deletions
  1. 24 19
      index.php
  2. 1 1
      js/offline.js
  3. 13 7
      offline.html

+ 24 - 19
index.php

@@ -100,27 +100,32 @@
 			<li><a href="offline.html">Local</a></li>
 		</ul>
 
-		<?php if ($mode == "favorites") { ?>
-			<form onsubmit="return false;" class="navbar-form navbar-right">
-				<button type="submit" onclick="offline_get_all()" class="btn btn-primary">Get all</button>
-			</form>
-		<?php } ?>
-
 		<form class="navbar-form navbar-right">
-			<input type="text" name="query" class="form-control"
-				value="<?php echo htmlspecialchars($query) ?>">
-			<input type="hidden" name="mode" value="<?php echo $mode ?>">
-			<button type="submit" class="btn btn-default">Search</button>
+			<div class="input-group">
+				<input type="text" name="query" class="form-control" placeholder="Search for..."
+					value="<?php echo htmlspecialchars($query) ?>">
+				<input type="hidden" name="mode" value="<?php echo $mode ?>">
+				<span class="input-group-btn">
+					<button type="submit" class="btn btn-default">Go</button>
+				</span>
+			</div>
 		</form>
 
-		<?php if ($mode != "favorites") { ?>
-
-			<ul class="nav navbar-nav navbar-right">
-			<li><a href="logout.php">Logout</a></li>
+		<ul class="nav navbar-nav navbar-right">
+			<li><a href="#" title="Refresh script cache" onclick="return cache_refresh(true)">
+				<span class="glyphicon glyphicon-refresh"></span> <span class='hidden-md hidden-lg'>Refresh script cache</span></a></li>
 			</li>
-
-		<?php } ?>
-
+			<?php if ($mode !== "favorites") { ?>
+				<li><a href="logout.php" title="Log out">
+					<span class="glyphicon glyphicon-log-out"></span> <span class='hidden-md hidden-lg'>Log out</span>
+				</a></li>
+			<?php } ?>
+			<?php if ($mode == "favorites") { ?>
+				<li><a href="#" onclick="offline_get_all()" title="Download all">
+					<span class="glyphicon glyphicon-download-alt text-primary"></span> <span class='hidden-md hidden-lg'>Download all</span>
+				</a></li>
+			<?php } ?>
+		</ul>
 	</div>
 
 </div>
@@ -403,9 +408,9 @@
 		<?php } ?>
 	</ul>
 
-	<p class="text-center small">
+	<!-- <p class="text-center small">
 		<a class="text-muted" href="#" onclick="return cache_refresh(true)">Refresh cache</a>
-	</p>
+	</p> -->
 
 
 </div>

+ 1 - 1
js/offline.js

@@ -26,7 +26,7 @@ function offline_remove2(elem) {
 /* exported offline_clear */
 function offline_clear() {
 
-	if (confirm("Remove all offline data?")) {
+	if (confirm("Remove all downloaded books?")) {
 
 		const promises = [];
 

+ 13 - 7
offline.html

@@ -41,16 +41,22 @@
 			<li class="active"><a href="offline.html">Local</a></li>
 		</ul>
 
-		<form onsubmit="return false;" class="navbar-form navbar-right">
-			<button type="submit" onclick="offline_clear()" class="btn btn-danger">Remove all</button>
-		</form>
-
 		<form 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>
+			<div class="input-group">
+				<input type="text" class="form-control search_query" name="query"
+					placeholder="Search for..." class="form-control" value="">
+					<span class="input-group-btn">
+						<button type="submit" class="btn btn-default">Go</button>
+					</span>
+			</div>
 		</form>
 
+		<ul class="nav navbar-nav navbar-right">
+			<li><a href="#" onclick="offline_clear()" title="Remove all downloads">
+				<span class="glyphicon glyphicon-remove-circle text-danger"></span> <span class='hidden-md hidden-lg'>Remove all downloads</span>
+			</a></li>
+		</ul>
+
 	</div>
 
 </div>