]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Add awesomplete to tag search shaarli/Shaarli#49 221/head
authorArthurHoaro <arthur@hoa.ro>
Tue, 9 Jun 2015 12:23:28 +0000 (14:23 +0200)
committerArthurHoaro <arthur@hoa.ro>
Tue, 9 Jun 2015 12:23:28 +0000 (14:23 +0200)
inc/shaarli.css
index.php
tpl/linklist.html

index c4348c70ff92757a8f102ed8509d26054041a19c..f54135249a80da97a14fdc64179db6ae3af94d81 100644 (file)
@@ -221,8 +221,17 @@ h1 {
     margin-left:24px;
 }
 
+.tagfilter div.awesomplete {
+    width: inherit;
+}
+
 .tagfilter #tagfilter_value {
-    width: 10%;
+    width: 100%;
+    display: inline;
+}
+
+.tagfilter li {
+    color: black;
 }
 
 .tagfilter input.bigbutton, .searchform input.bigbutton, .addform input.bigbutton {
index 9561f63b63a3975b897ab894334dfa1025168f7f..021d93ffefe6b795a52e293068a6aaee525d5e63 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2018,6 +2018,7 @@ function buildLinkList($PAGE,$LINKSDB)
     $PAGE->assign('redirector',empty($GLOBALS['redirector']) ? '' : $GLOBALS['redirector']); // Optional redirector URL.
     $PAGE->assign('token',$token);
     $PAGE->assign('links',$linkDisp);
+    $PAGE->assign('tags', $LINKSDB->allTags());
     return;
 }
 
index 766a80ce83044e9f5f07ee8b6df3d725e26414e9..47e67e71effd6e96ac8e93984c5c205ac532bb65 100644 (file)
@@ -1,12 +1,21 @@
 <!DOCTYPE html>
 <html>
-<head>{include="includes"}</head>
+<head>
+    <link type="text/css" rel="stylesheet" href="../inc/awesomplete.css" />
+    {include="includes"}
+</head>
 <body>
 <div id="pageheader">
     {include="page.header"}
     <div id="headerform" class="search">
         <form method="GET" class="searchform" name="searchform"><input type="text" id="searchform_value" name="searchterm" placeholder="Search text" value=""> <input type="submit" value="Search" class="bigbutton"></form>
-        <form method="GET" class="tagfilter" name="tagfilter"><input type="text" name="searchtags" id="tagfilter_value" placeholder="Filter by tag" value=""> <input type="submit" value="Search" class="bigbutton"></form>
+        <form method="GET" class="tagfilter" name="tagfilter">
+            <input type="text" name="searchtags" id="tagfilter_value" placeholder="Filter by tag" value="" list="tagsList" autocomplete="off" class="awesomplete" data-minChars="1">
+            <datalist id="tagsList">
+                {loop="$tags"}<option>{$key}</option>{/loop}
+            </datalist>
+            <input type="submit" value="Search" class="bigbutton">
+        </form>
     </div>
 </div>
 
@@ -129,5 +138,6 @@ function showQrCode(caller,loading)
     return false;
 }
 </script>
+<script src="inc/awesomplete.min.js#"></script>
 </body>
 </html>