Add awesomplete to tag search shaarli/Shaarli#49

This commit is contained in:
ArthurHoaro 2015-06-09 14:23:28 +02:00
parent cbecab7735
commit 65d6251744
3 changed files with 23 additions and 3 deletions

View file

@ -221,8 +221,17 @@ h1 {
margin-left:24px; margin-left:24px;
} }
.tagfilter div.awesomplete {
width: inherit;
}
.tagfilter #tagfilter_value { .tagfilter #tagfilter_value {
width: 10%; width: 100%;
display: inline;
}
.tagfilter li {
color: black;
} }
.tagfilter input.bigbutton, .searchform input.bigbutton, .addform input.bigbutton { .tagfilter input.bigbutton, .searchform input.bigbutton, .addform input.bigbutton {

View file

@ -2018,6 +2018,7 @@ function buildLinkList($PAGE,$LINKSDB)
$PAGE->assign('redirector',empty($GLOBALS['redirector']) ? '' : $GLOBALS['redirector']); // Optional redirector URL. $PAGE->assign('redirector',empty($GLOBALS['redirector']) ? '' : $GLOBALS['redirector']); // Optional redirector URL.
$PAGE->assign('token',$token); $PAGE->assign('token',$token);
$PAGE->assign('links',$linkDisp); $PAGE->assign('links',$linkDisp);
$PAGE->assign('tags', $LINKSDB->allTags());
return; return;
} }

View file

@ -1,12 +1,21 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>{include="includes"}</head> <head>
<link type="text/css" rel="stylesheet" href="../inc/awesomplete.css" />
{include="includes"}
</head>
<body> <body>
<div id="pageheader"> <div id="pageheader">
{include="page.header"} {include="page.header"}
<div id="headerform" class="search"> <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="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>
</div> </div>
@ -129,5 +138,6 @@
return false; return false;
} }
</script> </script>
<script src="inc/awesomplete.min.js#"></script>
</body> </body>
</html> </html>