From 2293928ac931508487c01f91e574399eb5deb80f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 19 Sep 2010 21:21:12 +0200 Subject: [PATCH] handle _escaped_fragment_ requests, not returning anything usefull for now --- pandora/app/views.py | 4 ++++ pandora/backend/views.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/pandora/app/views.py b/pandora/app/views.py index a5a79914f..c4c090a62 100644 --- a/pandora/app/views.py +++ b/pandora/app/views.py @@ -8,12 +8,16 @@ from oxdjango.shortcuts import json_response, render_to_json_response, get_objec import models +from backend.views import html_snapshot + def intro(request): context = RequestContext(request, {'settings':settings}) return render_to_response('intro.html', context) def index(request): context = RequestContext(request, {'settings':settings}) + if request.GET.get('_escaped_fragment_', None): + return html_snapshot(request) return render_to_response('index.html', context) def timeline(request): diff --git a/pandora/backend/views.py b/pandora/backend/views.py index 46963fbcf..a8060e7ed 100644 --- a/pandora/backend/views.py +++ b/pandora/backend/views.py @@ -578,3 +578,14 @@ def video(request, id, profile): content_type = path.endswith('.mp4') and 'video/mp4' or 'video/webm' return HttpFileResponse(path, content_type=content_type) + +''' + ajax html snapshots + http://code.google.com/web/ajaxcrawling/docs/html-snapshot.html +''' +def html_snapshot(request): + fragment = unquote(request.GET['_escaped_fragment_']) + url = request.build_absolute_uri('/ra') + url = 'http://'+settings.URL + response = HttpResponse('sorry, server side rendering for %s!#%s not yet implemented'%(url, fragment)) + return response