summaryrefslogtreecommitdiff
path: root/templates/public
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 00:51:40 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-04-15 00:51:40 -0400
commit0e7d8abd052418a9dbf79aac43ad388d2d16b043 (patch)
treea883bd585046ba5be7561b3f315c8a57dcbbd15f /templates/public
parent67b87ed4c0abd593e2833b3aa6b969c2e2451b60 (diff)
parent98e3d3126710a827c1ea1296f38e3e29adf37857 (diff)
Merge branch 'mkjs' into archweb-generic
Diffstat (limited to 'templates/public')
-rw-r--r--templates/public/index.html38
1 files changed, 1 insertions, 37 deletions
diff --git a/templates/public/index.html b/templates/public/index.html
index a6bd1fb1..a6ff7e9f 100644
--- a/templates/public/index.html
+++ b/templates/public/index.html
@@ -216,44 +216,8 @@
{% load cdn %}{% jquery %}
<script type="text/javascript">
-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() {
- var konami = new Konami(function() {
- $('#konami').html('<img src="{% static "vector_tux.png" %}" alt=""/>');
- setTimeout(function() {
- $('#konami').fadeIn(500);
- }, 500);
- $('#konami').click(function() {
- $('#konami').fadeOut(500);
- });
- });
-}
$(document).ready(function() {
- $.ajax({ url: "{% static "bootstrap-typeahead.min.js" %}", cache: true, dataType: "script", success: setupTypeahead });
- $.ajax({ url: "{% static "konami.min.js" %}", cache: true, dataType: "script", success: setupKonami });
+ $.ajax({ url: "{% static "homepage.js" %}", cache: true, dataType: "script", success: function() { setupTypeahead(); setupKonami("{% static "vector_tux.png" %}"); } });
});
</script>
{% endblock %}