summaryrefslogtreecommitdiff
path: root/Makefile.d/homepage.js.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 01:29:41 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 01:29:41 -0400
commit90873ef7de4bf842fbf6971836a373c555cfcbaa (patch)
tree52608c90e8a0fa13b1f2b4ccfade1d9162beb5d1 /Makefile.d/homepage.js.in
parent65e3ef63f7475a217da5205a788f52f3888ebea7 (diff)
parent7a8b5707b277f052b712c51574b0e28834b5a5f8 (diff)
Merge branch 'archweb-generic' into master-nomake
Diffstat (limited to 'Makefile.d/homepage.js.in')
-rw-r--r--Makefile.d/homepage.js.in36
1 files changed, 36 insertions, 0 deletions
diff --git a/Makefile.d/homepage.js.in b/Makefile.d/homepage.js.in
new file mode 100644
index 00000000..2d6f7910
--- /dev/null
+++ b/Makefile.d/homepage.js.in
@@ -0,0 +1,36 @@
+function setupTypeahead() {
+ $('#pkgsearch-field').typeahead({
+ source: function(query, callback) {
+ $.getJSON('/opensearch/packages/suggest', {q: query}, function(data) {
+ callback(data[1]);
+ });
+ },
+ matcher: function(item) { return true; },
+ sorter: function(items) { return items; },
+ menu: '<ul class="pkgsearch-typeahead"></ul>',
+ items: 10,
+ updater: function(item) {
+ $('#pkgsearch-field').val(item);
+ $('#pkgsearch-form').submit();
+ return item;
+ }
+ }).attr('autocomplete', 'off');
+ $('#pkgsearch-field').keyup(function(e) {
+ if (e.keyCode === 13 &&
+ $('ul.pkgsearch-typeahead li.active').size() === 0) {
+ $('#pkgsearch-form').submit();
+ }
+ });
+}
+
+function setupKonami(image_src) {
+ var konami = new Konami(function() {
+ $('#konami').html('<img src="' + image_src + '" alt=""/>');
+ setTimeout(function() {
+ $('#konami').fadeIn(500);
+ }, 500);
+ $('#konami').click(function() {
+ $('#konami').fadeOut(500);
+ });
+ });
+}