diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-15 00:37:35 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-04-15 00:37:35 -0400 |
commit | 98e3d3126710a827c1ea1296f38e3e29adf37857 (patch) | |
tree | fdf6bdab593a70c0c34ceecd989b0ae00aa54c66 /Makefile.d/homepage.js.in | |
parent | abb3a507a1e8f218b5225d3e00187808e323e48a (diff) |
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.
Diffstat (limited to 'Makefile.d/homepage.js.in')
-rw-r--r-- | Makefile.d/homepage.js.in | 36 |
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); + }); + }); +} |