Only include transifex JS if the ENV var is set

... otherwise, don't bother loading this blocking external resource.
This commit is contained in:
James Mason 2017-11-12 20:43:02 -08:00
parent 0e16b5d0ae
commit fba12aef24
No known key found for this signature in database
GPG key ID: 1B3951886C449023

View file

@ -9,6 +9,8 @@
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
= content_for(:script_head)
- if ENV['OSEM_TRANSIFEX_APIKEY']
:javascript :javascript
window.liveSettings = { window.liveSettings = {
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}", api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
@ -16,7 +18,6 @@
detectlang: true, detectlang: true,
autocollect: true autocollect: true
}; };
= content_for(:script_head)
= javascript_include_tag "//cdn.transifex.com/live.js" = javascript_include_tag "//cdn.transifex.com/live.js"
= yield(:head) = yield(:head)