Commit 250fdf8a authored by Roque's avatar Roque

erp5_web_renderjs_ui: refactor

parent d29107a7
...@@ -30,12 +30,13 @@ web_content = web_page.getTextContent() ...@@ -30,12 +30,13 @@ web_content = web_page.getTextContent()
if (portal_type == "Web Script"): if (portal_type == "Web Script"):
response.setHeader('Content-Type', 'application/javascript; charset=utf-8') response.setHeader('Content-Type', 'application/javascript; charset=utf-8')
if web_page.getTextContentSubstitutionMappingMethodId(): if web_page.getTextContentSubstitutionMappingMethodId():
precache_manifest = web_section.getLayoutProperty("configuration_precache_manifest_script", default="WebSection_getPrecacheManifest")
precache_manifest_content = getattr(web_section, precache_manifest)()
web_content = web_page.TextDocument_substituteTextContent(web_content, mapping_dict={ web_content = web_page.TextDocument_substituteTextContent(web_content, mapping_dict={
'modification_date': modification_date_string, 'modification_date': modification_date_string,
# Make JSLint happy for the service worker code # Make JSLint happy for the service worker code
'required_url_list': json.dumps(precache_manifest_content) 'required_url_list': json.dumps(
getattr(web_section, web_section.getLayoutProperty("configuration_precache_manifest_script",
default="WebSection_getPrecacheManifest"))()
)
}) })
elif (portal_type == "Web Style"): elif (portal_type == "Web Style"):
......
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