From 98e3d3126710a827c1ea1296f38e3e29adf37857 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 15 Apr 2015 00:37:35 -0400 Subject: Add a Makefile to generate all of the 3rd party or minimized Javascript. The goal here is to generate the files *exactly* as they are currently in the repository, which sometimes means using a specific version of a minifier or other weird things. --- Makefile.d/homepage.js.in | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Makefile.d/homepage.js.in (limited to 'Makefile.d/homepage.js.in') 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: '', + 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(''); + setTimeout(function() { + $('#konami').fadeIn(500); + }, 500); + $('#konami').click(function() { + $('#konami').fadeOut(500); + }); + }); +} -- cgit v1.2.3-54-g00ecf