Package omeroweb :: Package webclient :: Module webclient_http
[hide private]
[frames] | no frames]

Source Code for Module omeroweb.webclient.webclient_http

 1  #!/usr/bin/env python 
 2  # 
 3  # 
 4  # Copyright (C) 2011 University of Dundee & Open Microscopy Environment. 
 5  # All rights reserved. 
 6  # 
 7  # This program is free software: you can redistribute it and/or modify 
 8  # it under the terms of the GNU Affero General Public License as 
 9  # published by the Free Software Foundation, either version 3 of the 
10  # License, or (at your option) any later version. 
11  # 
12  # This program is distributed in the hope that it will be useful, 
13  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
15  # GNU Affero General Public License for more details. 
16  # 
17  # You should have received a copy of the GNU Affero General Public License 
18  # along with this program.  If not, see <http://www.gnu.org/licenses/>. 
19  # 
20   
21  from django.http import HttpResponse 
22   
23 -class HttpJavascriptRedirect(HttpResponse):
24 - def __init__(self,content):
25 content = '<html><body onLoad="javascript:window.top.location.href=\'%s\'"></body></html>' % content 26 HttpResponse.__init__(self,content)
27 28
29 -class HttpJavascriptResponse(HttpResponse):
30 - def __init__(self,content):
31 HttpResponse.__init__(self,content,mimetype="text/javascript")
32 33
34 -class HttpLoginRedirect(HttpResponse):
35 - def __init__(self,content):
36 content = """<html><body onLoad="top.location.replace('%s');"></body></html>""" % content 37 HttpResponse.__init__(self,content)
38