[NEW] Provide new Livechat client as community feature (#13723)
parent
558911336e
commit
36e7e25904
@ -1,10 +1,18 @@ |
||||
<template name="livechatInstallation"> |
||||
{{#requiresPermission 'view-livechat-manager'}} |
||||
<p>{{{_ "To_install_RocketChat_Livechat_in_your_website_copy_paste_this_code_above_the_last_body_tag_on_your_site"}}}</p> |
||||
<p>{{{_ "To_install_the_new_version_of_RocketChat_Livechat_in_your_website_copy_paste_this_code_above_the_last_body_tag_on_your_site"}}}</p> |
||||
|
||||
<div class="livechat-code"> |
||||
<textarea class="clipboard" data-clipboard-target=".livechat-code textarea">{{script}}</textarea> |
||||
<button class="button clipboard" data-clipboard-target=".livechat-code textarea"><i class="icon-docs"></i>{{_ "Copy_to_clipboard"}}</button> |
||||
</div> |
||||
|
||||
<p>{{{_ "To_install_RocketChat_Livechat_in_your_website_copy_paste_this_code_above_the_last_body_tag_on_your_site"}}}</p> |
||||
|
||||
<div class="livechat-code clipboard-old"> |
||||
<textarea class="clipboard" data-clipboard-target=".clipboard-old textarea">{{oldScript}}</textarea> |
||||
<button class="button clipboard" data-clipboard-target=".clipboard-old textarea"><i class="icon-docs"></i>{{_ "Copy_to_clipboard"}}</button> |
||||
</div> |
||||
|
||||
{{/requiresPermission}} |
||||
</template> |
||||
|
||||
@ -0,0 +1,29 @@ |
||||
import { Autoupdate } from 'meteor/autoupdate'; |
||||
|
||||
export const addServerUrlToIndex = (file) => file.replace('<body>', `<body><script> SERVER_URL = '${ __meteor_runtime_config__.ROOT_URL }'; </script>`); |
||||
|
||||
export const addServerUrlToHead = (head) => { |
||||
let baseUrl; |
||||
if (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX && __meteor_runtime_config__.ROOT_URL_PATH_PREFIX.trim() !== '') { |
||||
baseUrl = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX; |
||||
} else { |
||||
baseUrl = '/'; |
||||
} |
||||
if (/\/$/.test(baseUrl) === false) { |
||||
baseUrl += '/'; |
||||
} |
||||
|
||||
return `<html>
|
||||
<head> |
||||
<link rel="stylesheet" type="text/css" class="__meteor-css__" href="${ baseUrl }livechat/livechat.css?_dc=${ Autoupdate.autoupdateVersion }"> |
||||
<script type="text/javascript"> |
||||
__meteor_runtime_config__ = ${ JSON.stringify(__meteor_runtime_config__) }; |
||||
</script> |
||||
<base href="${ baseUrl }"> |
||||
${ head } |
||||
</head> |
||||
<body> |
||||
<script type="text/javascript" src="${ baseUrl }livechat/livechat.js?_dc=${ Autoupdate.autoupdateVersion }"></script> |
||||
</body> |
||||
</html>`; |
||||
}; |
||||
Loading…
Reference in new issue