aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2015-06-09 14:23:28 +0200
committerArthurHoaro <arthur@hoa.ro>2015-06-09 14:23:28 +0200
commit65d62517443b67fc4a180c43b50fe62f11b9e3b6 (patch)
tree17a397a31eda1324710745ed7bbe8773752f77cd
parentcbecab773526b0c39f3cffa1d4595b5caa781bda (diff)
downloadShaarli-65d62517443b67fc4a180c43b50fe62f11b9e3b6.tar.gz
Shaarli-65d62517443b67fc4a180c43b50fe62f11b9e3b6.tar.zst
Shaarli-65d62517443b67fc4a180c43b50fe62f11b9e3b6.zip
Add awesomplete to tag search shaarli/Shaarli#49
-rw-r--r--inc/shaarli.css11
-rw-r--r--index.php1
-rw-r--r--tpl/linklist.html14
3 files changed, 23 insertions, 3 deletions
diff --git a/inc/shaarli.css b/inc/shaarli.css
index c4348c70..f5413524 100644
--- a/inc/shaarli.css
+++ b/inc/shaarli.css
@@ -221,8 +221,17 @@ h1 {
221 margin-left:24px; 221 margin-left:24px;
222} 222}
223 223
224.tagfilter div.awesomplete {
225 width: inherit;
226}
227
224.tagfilter #tagfilter_value { 228.tagfilter #tagfilter_value {
225 width: 10%; 229 width: 100%;
230 display: inline;
231}
232
233.tagfilter li {
234 color: black;
226} 235}
227 236
228.tagfilter input.bigbutton, .searchform input.bigbutton, .addform input.bigbutton { 237.tagfilter input.bigbutton, .searchform input.bigbutton, .addform input.bigbutton {
diff --git a/index.php b/index.php
index 9561f63b..021d93ff 100644
--- a/index.php
+++ b/index.php
@@ -2018,6 +2018,7 @@ function buildLinkList($PAGE,$LINKSDB)
2018 $PAGE->assign('redirector',empty($GLOBALS['redirector']) ? '' : $GLOBALS['redirector']); // Optional redirector URL. 2018 $PAGE->assign('redirector',empty($GLOBALS['redirector']) ? '' : $GLOBALS['redirector']); // Optional redirector URL.
2019 $PAGE->assign('token',$token); 2019 $PAGE->assign('token',$token);
2020 $PAGE->assign('links',$linkDisp); 2020 $PAGE->assign('links',$linkDisp);
2021 $PAGE->assign('tags', $LINKSDB->allTags());
2021 return; 2022 return;
2022} 2023}
2023 2024
diff --git a/tpl/linklist.html b/tpl/linklist.html
index 766a80ce..47e67e71 100644
--- a/tpl/linklist.html
+++ b/tpl/linklist.html
@@ -1,12 +1,21 @@
1<!DOCTYPE html> 1<!DOCTYPE html>
2<html> 2<html>
3<head>{include="includes"}</head> 3<head>
4 <link type="text/css" rel="stylesheet" href="../inc/awesomplete.css" />
5 {include="includes"}
6</head>
4<body> 7<body>
5<div id="pageheader"> 8<div id="pageheader">
6 {include="page.header"} 9 {include="page.header"}
7 <div id="headerform" class="search"> 10 <div id="headerform" class="search">
8 <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> 11 <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>
9 <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> 12 <form method="GET" class="tagfilter" name="tagfilter">
13 <input type="text" name="searchtags" id="tagfilter_value" placeholder="Filter by tag" value="" list="tagsList" autocomplete="off" class="awesomplete" data-minChars="1">
14 <datalist id="tagsList">
15 {loop="$tags"}<option>{$key}</option>{/loop}
16 </datalist>
17 <input type="submit" value="Search" class="bigbutton">
18 </form>
10 </div> 19 </div>
11</div> 20</div>
12 21
@@ -129,5 +138,6 @@ function showQrCode(caller,loading)
129 return false; 138 return false;
130} 139}
131</script> 140</script>
141<script src="inc/awesomplete.min.js#"></script>
132</body> 142</body>
133</html> 143</html>