From ac2553cdff459d2f0313fbbcc38b3817248d98fc Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Tue, 4 Sep 2012 12:45:45 -0400 Subject: [PATCH] Replace get_state with a variable embedded into index.html (imported from commit 3ef4a0163107248618a25e242ab30fdff5da17e0) --- humbug/urls.py | 1 - templates/zephyr/index.html | 1 + zephyr/static/js/zephyr.js | 4 +--- zephyr/views.py | 10 ---------- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/humbug/urls.py b/humbug/urls.py index 733d1140cb..8e83845e06 100644 --- a/humbug/urls.py +++ b/humbug/urls.py @@ -9,7 +9,6 @@ import os.path urlpatterns = patterns('', url(r'^$', 'zephyr.views.home', name='home'), url(r'^update$', 'zephyr.views.update', name='update'), - url(r'^get_state$', 'zephyr.views.get_state', name='get_state'), url(r'^get_updates_longpoll$', 'zephyr.views.get_updates_longpoll', name='get_updates_longpoll'), url(r'^zephyr/', 'zephyr.views.zephyr', name='zephyr'), url(r'^personal-zephyr/', 'zephyr.views.personal_zephyr', name='personal_zephyr'), diff --git a/templates/zephyr/index.html b/templates/zephyr/index.html index 01aebcc7bb..18c740018a 100644 --- a/templates/zephyr/index.html +++ b/templates/zephyr/index.html @@ -12,6 +12,7 @@ diff --git a/zephyr/static/js/zephyr.js b/zephyr/static/js/zephyr.js index 0d9c5975f0..6fba92b7ba 100644 --- a/zephyr/static/js/zephyr.js +++ b/zephyr/static/js/zephyr.js @@ -295,10 +295,8 @@ $(function () { $.get('/static/templates/zephyr.html', function (template) { ich.addTemplate('zephyr', template); $(initial_zephyr_json).each(add_message); + select_zephyr($("#" + initial_pointer)); get_updates_longpoll(); - $.get('get_state', function(data) { - select_zephyr($("#" + data.pointer)); - }, dataType="json"); }); }); diff --git a/zephyr/views.py b/zephyr/views.py index 9f4d82ef0d..d566da1352 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -69,16 +69,6 @@ def update(request): user_profile.save() return HttpResponse(simplejson.dumps({}), mimetype='application/json') -@login_required -def get_state(request): - if not request.GET: - # Do something - pass - - user_profile = UserProfile.objects.get(user=request.user) - return HttpResponse(simplejson.dumps({"pointer": user_profile.pointer}), - mimetype='application/json') - @asynchronous def get_updates_longpoll(request, handler): if not request.POST: