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