summaryrefslogtreecommitdiffstats
path: root/web/template/pkgreq_form.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-07-23 15:55:11 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-07-23 17:53:30 +0200
commit0a357a7d44aa3591c646daded8c25853eeafa5a3 (patch)
treec81174178f914c45906c4d071011a13558f20094 /web/template/pkgreq_form.php
parent48ae736068f9953ba69c91190ef7eb7b056c2b50 (diff)
downloadaur-0a357a7d44aa3591c646daded8c25853eeafa5a3.tar.gz
aur-0a357a7d44aa3591c646daded8c25853eeafa5a3.tar.xz
Add typeahead suggest to the merge request form
Add the typeahead implementation we already use for the package search to the merge target text field. Instead of suggesting packages, suggest package base names. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/template/pkgreq_form.php')
-rw-r--r--web/template/pkgreq_form.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/template/pkgreq_form.php b/web/template/pkgreq_form.php
index cc45f298..623c2472 100644
--- a/web/template/pkgreq_form.php
+++ b/web/template/pkgreq_form.php
@@ -23,6 +23,7 @@
</select>
</p>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
+ <script type="text/javascript" src="/js/bootstrap-typeahead.min.js"></script>
<script type="text/javascript">
function showHideMergeSection() {
if ($('#id_type').val() == 'merge') {
@@ -34,6 +35,18 @@
$(document).ready(function() {
showHideMergeSection();
+
+ $('#id_merge_into').typeahead({
+ source: function(query, callback) {
+ $.getJSON('<?= get_uri('/rpc'); ?>', {type: "suggest-pkgbase", arg: query}, function(data) {
+ callback(data);
+ });
+ },
+ matcher: function(item) { return true; },
+ sorter: function(items) { return items; },
+ menu: '<ul class="pkgsearch-typeahead"></ul>',
+ items: 20
+ }).attr('autocomplete', 'off');
});
</script>
<p id="merge_section">