add new theme
[mlpccg-meta.git] / meta / static / js / main.js
index 8b13789..8177d41 100644 (file)
@@ -1 +1,23 @@
+function rateDeck() {
+    $.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()
+    });
+});