Include the chat front-end if chat is enabled
* add jsxc helper file
This commit is contained in:
parent
556190b154
commit
ea11133084
2 changed files with 16 additions and 0 deletions
13
app/helpers/jsxc_helper.rb
Normal file
13
app/helpers/jsxc_helper.rb
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue