From a7951e86f77b04463a1ceaa0193f9c941f420edd Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 20 2016 21:04:23 +0000 Subject: Move the logic to a separate file and re-import fedora-bootstrap --- diff --git a/hubs/static/js/hubs_input.js b/hubs/static/js/hubs_input.js new file mode 100644 index 0000000..79b0fb0 --- /dev/null +++ b/hubs/static/js/hubs_input.js @@ -0,0 +1,13 @@ +$(function(){ + if ($('#calendar') != null){ + $.get( + 'https://apps.fedoraproject.org/calendar/api/calendars/', + function(data){ + data = JSON.parse(data); + var d = data.calendars.map(function(cal) { return cal.calendar_name; }); + $('#calendar').typeahead({ source: d }); + }, + 'jsonp' + ); + } +}); diff --git a/hubs/templates/edit.html b/hubs/templates/edit.html index 9f536a6..a04145a 100644 --- a/hubs/templates/edit.html +++ b/hubs/templates/edit.html @@ -50,22 +50,8 @@ + - +