Mercurial > personas_backend
changeset 114:95ed7c25c065
Fixed the legacy persona wrapper so that it works properly on Firefox 2 (tested it out to make sure it works on FF2, and it does).
author | avarma@sm-labs01.mozilla.org |
---|---|
date | Fri, 28 Mar 2008 18:37:59 -0700 |
parents | 8464f9b48e90 |
children | a1e344b3c064 |
files | PersonasBackend/personas/templates/personas/legacy_footer.html PersonasBackend/personas/templates/personas/legacy_header.html PersonasBackend/personas/templates/personas/legacy_persona.xul PersonasBackend/personas/views.py |
diffstat | 4 files changed, 22 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/PersonasBackend/personas/templates/personas/legacy_footer.html Fri Mar 28 17:19:56 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -<html> -<head> -<style type="text/css"> - body { - margin-top:0; - margin-bottom:0; - margin-left:0; - margin-right:0; - background-image: url({{image}}); - background-position: bottom left } -</style> -</head> -<body></body> -</html>
--- a/PersonasBackend/personas/templates/personas/legacy_header.html Fri Mar 28 17:19:56 2008 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -<html> -<head> -<style type="text/css"> - body { - margin-top:0; - margin-bottom:0; - margin-left:0; - margin-right:0 - } -</style> -</head> -<body><img src="{{image}}" /></body> -</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PersonasBackend/personas/templates/personas/legacy_persona.xul Fri Mar 28 18:37:59 2008 -0700 @@ -0,0 +1,17 @@ +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + flex="1" + style="background-repeat: no-repeat;" + onload="document.documentElement.style.backgroundImage = 'url({{image}})'"> + + <!-- Because CSS image loads don't block the load/pageshow events in Firefox 2, + - we load the image in an image tag, which does block those events, and then + - set the background-image property once the image has finished loading. --> + <image id="image" collapsed="true"/> + + <script type="application/javascript;version=1.7"> + <![CDATA[ + document.getElementById("image").setAttribute("src", "{{image}}"); + document.documentElement.style.backgroundPosition = "{{position}}"; + ]]> + </script> +</window>
--- a/PersonasBackend/personas/views.py Fri Mar 28 17:19:56 2008 -0700 +++ b/PersonasBackend/personas/views.py Fri Mar 28 18:37:59 2008 -0700 @@ -18,18 +18,19 @@ action = request.GET.get( "action", "" ) if action == "footer": - template_name = "personas/legacy_footer.html" + position = "bottom left" img_src = FOOTER_URL % urldict elif action == "header": - template_name = "personas/legacy_header.html" + position = "top right" img_src = HEADER_URL % urldict else: return HttpResponseBadRequest( "Invalid or unsupported action: %s" % action ) return render_to_response( - template_name, - { "image" : img_src } + "personas/legacy_persona.xul", + { "image" : img_src, "position" : position }, + mimetype = "application/vnd.mozilla.xul+xml" ) def list_view( request ):