Skip to content

Commit

Permalink
attempt at typeahead
Browse files Browse the repository at this point in the history
  • Loading branch information
seshness committed Sep 24, 2011
1 parent 3372255 commit 6913057
Show file tree
Hide file tree
Showing 6 changed files with 9,124 additions and 44 deletions.
5 changes: 5 additions & 0 deletions socialtasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ def get_fully_qualified_path(short_path='/'):
else:
return 'https://' + request.host + short_path

@app.route('/typeahead/json/', methods=['GET'])
def typeahead():
if 'access_token' in session and session['expires'] <= time.time():
user_friends = fb_call('me/friends', session['access_token'])['data']
return flask.jsonify(user_friends)

@app.route('/close/', methods=['GET', 'POST'])
def close():
Expand Down
18 changes: 14 additions & 4 deletions static/js/create_task.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
$(function () {
$('#create_form').submit(function (event) {
event.preventDefault();
<<<<<<< Updated upstream
$.ajax({
type: 'POST',
url: '/task/make/',
data: {'content': $('#task_text').val(), 'title': $('#task_title').val()},
success: function(response) {
=======
alert('sending ajax post');
$.ajax({
type: 'POST',
url: '/task/make/',
data: {'content': $('#task_text').val(), 'title': $('#task_title').val()},
success: function(response) {
alert('successful post');
>>>>>>> Stashed changes
$('#main_content').load('ajax/home/');
$('#top_create').attr('class', '');
$('#top_mytasks').attr('class', 'active');
}
});
$('#top_create').attr('class', '');
$('#top_mytasks').attr('class', 'active');
}
});
});
});
Loading

0 comments on commit 6913057

Please sign in to comment.