Use "mibewRoot" only in file paths

This commit is contained in:
Dmitriy Simushev 2014-09-04 12:53:13 +00:00
parent 0253f8e67e
commit e5031f9987
7 changed files with 26 additions and 4 deletions

View File

@ -70,7 +70,7 @@
playNewMessageSound: function() {
if (! this.get('skipNextMessageSound')) {
// Build sound path
var path = Mibew.Objects.Models.page.get('mibewRoot');
var path = Mibew.Objects.Models.page.get('mibewBasePath');
if (typeof path !== 'undefined') {
path += '/sounds/new_message';
// Play sound

View File

@ -165,7 +165,7 @@
*/
threadAdded: function() {
// Build sound path
var path = Mibew.Objects.Models.page.get('mibewRoot');
var path = Mibew.Objects.Models.page.get('mibewBasePath');
if (typeof path !== 'undefined') {
path += '/sounds/new_user';
// Play sound

View File

@ -70,6 +70,9 @@ class OperatorChatController extends AbstractController
// Build js application options
$page['chatOptions'] = json_encode($page['chat']);
$page['mibewBasePath'] = $request->getBasePath();
$page['mibewBaseUrl'] = $request->getBaseUrl();
// Render the page with chat.
return $this->render('chat', $page);
}

View File

@ -56,6 +56,9 @@ class UserChatController extends AbstractController
// Build js application options
$page['chatOptions'] = json_encode($page['chat']);
$page['mibewBasePath'] = $request->getBasePath();
$page['mibewBaseUrl'] = $request->getBaseUrl();
// Expand page
return $this->render('chat', $page);
}
@ -141,6 +144,10 @@ class UserChatController extends AbstractController
$group_id,
$info,
$referrer
),
array(
'mibewBasePath' => $request->getBasePath(),
'mibewBaseUrl' => $request->getBaseUrl(),
)
);
$page['leaveMessageOptions'] = json_encode($page['leaveMessage']);
@ -173,6 +180,10 @@ class UserChatController extends AbstractController
$group_id,
$info,
$referrer
),
array(
'mibewBasePath' => $request->getBasePath(),
'mibewBaseUrl' => $request->getBaseUrl(),
)
);
$page['surveyOptions'] = json_encode($page['survey']);
@ -239,6 +250,9 @@ class UserChatController extends AbstractController
// Build js application options
$page['invitationOptions'] = json_encode($page['invitation']);
$page['mibewBasePath'] = $request->getBasePath();
$page['mibewBaseUrl'] = $request->getBaseUrl();
// Expand page
return $this->render('chat', $page);
}

View File

@ -60,6 +60,9 @@ class UsersController extends AbstractController
$page['inviteLink'] = $request->getBaseUrl() . '/operator/invite';
$page['agentLink'] = $request->getBaseUrl() . '/operator/chat';
$page['mibewBasePath'] = $request->getBasePath();
$page['mibewBaseUrl'] = $request->getBaseUrl();
// Load dialogs style options
$chat_style = new ChatStyle(ChatStyle::getCurrentStyle());
$style_config = $chat_style->getConfigurations();

View File

@ -82,7 +82,8 @@
},
page: {
style: '{{styleName}}',
mibewRoot: '{{mibewRoot}}',
mibewBasePath: '{{mibewBasePath}}',
mibewBaseUrl: '{{mibewBaseUrl}}',
stylePath: '{{stylePath}}',
company: {
name: '{{#jsString}}{{company.name}}{{/jsString}}',

View File

@ -89,7 +89,8 @@
},
page: {
mibewRoot: "{{mibewRoot}}",
mibewBasePath: "{{mibewBasePath}}",
mibewBaseUrl: "{{mibewBaseUrl}}",
showOnlineOperators: {{#if showonline}}true{{else}}false{{/if}},
showVisitors: {{#if showvisitors}}true{{else}}false{{/if}},