Commit 9f8dd82c authored by Yusei Tahara's avatar Yusei Tahara

[erp5_web_renderjs_ui] Use absolute wallpaper image URL to support firefox.

parent 70cf895f
import json import json
import re import re
import urlparse
if REQUEST is None: if REQUEST is None:
REQUEST = context.REQUEST REQUEST = context.REQUEST
...@@ -73,6 +74,10 @@ wallpaper_url = web_section.getLayoutProperty("configuration_wallpaper_url", def ...@@ -73,6 +74,10 @@ wallpaper_url = web_section.getLayoutProperty("configuration_wallpaper_url", def
if wallpaper_url is None: if wallpaper_url is None:
mapping_dict["extra_css_full_link_tag"] = '' mapping_dict["extra_css_full_link_tag"] = ''
else: else:
if not urlparse.urlparse(wallpaper_url).scheme:
wallpaper_absolute_url = urlparse.urljoin(root_website_url+'/', wallpaper_url);
else:
wallpaper_absolute_url = wallpaper_url
from base64 import urlsafe_b64encode from base64 import urlsafe_b64encode
mapping_dict["extra_css_full_link_tag"] = '<link rel="stylesheet" href="data:text/css;base64,%s">' % urlsafe_b64encode(""" mapping_dict["extra_css_full_link_tag"] = '<link rel="stylesheet" href="data:text/css;base64,%s">' % urlsafe_b64encode("""
html::after { html::after {
...@@ -89,6 +94,6 @@ else: ...@@ -89,6 +94,6 @@ else:
background-attachment: fixed; background-attachment: fixed;
background-image: url("%s"); background-image: url("%s");
} }
""" % wallpaper_url); """ % wallpaper_absolute_url);
return view_as_web_method(mapping_dict=mapping_dict) return view_as_web_method(mapping_dict=mapping_dict)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment