Include the chat front-end if chat is enabled

* add jsxc helper file
This commit is contained in:
Lukas Matt 2014-11-13 11:34:21 +01:00
parent 556190b154
commit ea11133084
2 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,13 @@
module JsxcHelper
def get_bosh_endpoint
port = AppConfig.chat.server.bosh.port
bind = AppConfig.chat.server.bosh.bind
host = AppConfig.pod_uri.host
scheme = AppConfig.pod_uri.scheme
unless AppConfig.chat.server.bosh.proxy?
return "http://#{host}:#{port}#{bind}"
end
return "#{scheme}://#{host}#{bind}"
end
end

View file

@ -4,6 +4,9 @@
- content_for :head do
= javascript_include_tag :home
- if AppConfig.chat.enabled?
= javascript_include_tag :jsxc, :id => 'jsxc',
:data => { :endpoint => get_bosh_endpoint }
- if current_user.getting_started?
#welcome-to-diaspora