X-Git-Url: https://git.yukkurigames.com/?p=mlpccg-meta.git;a=blobdiff_plain;f=meta%2Fstatic%2Fjs%2Fmain.js;h=8177d414d07a05de9e5e510d090a7743c02e81bd;hp=4df27d2fa16ce7b0a90ede5a5f4e483362338734;hb=227cf8c2dd8053ffd94c027365f88d04c2b85e3a;hpb=22a94820738824527277e21f2f37bc77638e12bc diff --git a/meta/static/js/main.js b/meta/static/js/main.js index 4df27d2..8177d41 100644 --- a/meta/static/js/main.js +++ b/meta/static/js/main.js @@ -1,5 +1,23 @@ function rateDeck() { - $.getJSON('/meta/rate', {url: $('#ponyheadURL').val()}, function(data) { + $.getJSON('/rate', {url: $('#ponyheadURL').val()}, function(data) { console.log(data); }); } + +var tournaments = new Bloodhound({ + datumTokenizer: Bloodhound.tokenizers.obj.nonword('name'), + queryTokenizer: Bloodhound.tokenizers.nonword, + prefetch: '/tournaments' +}); + +tournaments.clearPrefetchCache() +tournaments.initialize(); + +$(document).ready(function() { + $('.typeahead-tournaments').typeahead({ + highlight: true + }, { + displayKey: 'name', + source: tournaments.ttAdapter() + }); +});