FEATURE: Load translation overrides without JS eval

This commit is contained in:
Gerhard Schlager
2019-11-05 02:15:44 +01:00
parent ca6adfbdd6
commit 61b1f9c36b
14 changed files with 181 additions and 87 deletions

View File

@@ -93,9 +93,14 @@ module ApplicationHelper
def preload_script(script)
path = script_asset_path(script)
preload_script_url(path)
end
"<link rel='preload' href='#{path}' as='script'/>
<script src='#{path}'></script>".html_safe
def preload_script_url(url)
<<~HTML.html_safe
<link rel="preload" href="#{url}" as="script">
<script src="#{url}"></script>
HTML
end
def discourse_csrf_tags