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,15 +9,16 @@
= javascript_include_tag "application" = javascript_include_tag "application"
= csrf_meta_tags = csrf_meta_tags
:javascript
window.liveSettings = {
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
picker: "bottom-right",
detectlang: true,
autocollect: true
};
= content_for(:script_head) = content_for(:script_head)
= javascript_include_tag "//cdn.transifex.com/live.js" - if ENV['OSEM_TRANSIFEX_APIKEY']
:javascript
window.liveSettings = {
api_key: "#{ENV['OSEM_TRANSIFEX_APIKEY']}",
picker: "bottom-right",
detectlang: true,
autocollect: true
};
= javascript_include_tag "//cdn.transifex.com/live.js"
= yield(:head) = yield(:head)
%body %body