handle _escaped_fragment_ requests, not returning anything usefull for now

This commit is contained in:
j 2010-09-19 21:21:12 +02:00
parent d727097a7c
commit 2293928ac9
2 changed files with 15 additions and 0 deletions

View file

@ -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):

View file

@ -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