From 71c327f14c9e32eb1f3cb87569f83aa2ddac5e25 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 8 Apr 2013 09:59:52 +0000 Subject: [PATCH] Fix bug with client side plugins initialization --- src/messenger/webim/libs/chat.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/messenger/webim/libs/chat.php b/src/messenger/webim/libs/chat.php index 55a05759..318fce94 100644 --- a/src/messenger/webim/libs/chat.php +++ b/src/messenger/webim/libs/chat.php @@ -175,11 +175,6 @@ function prepare_chat_app_data() { // Set refresh frequency $data['frequency'] = Settings::get('updatefrequency_chat'); - // Load JavaScript plugins and JavaScripts, CSS files required by them - $data['additional_css'] = get_additional_css('client_chat_window'); - $data['additional_js'] = get_additional_js('client_chat_window'); - $data['js_plugin_options'] = get_js_plugin_options('client_chat_window'); - // Set some localized strings $data['localized'] = array( 'email.required' => no_field("form.field.email"), @@ -444,6 +439,11 @@ function setup_chatview_for_user(Thread $thread) { $data = setup_chatview($thread); + // Load JavaScript plugins and JavaScripts, CSS files required by them + $data['additional_css'] = get_additional_css('client_chat_window'); + $data['additional_js'] = get_additional_js('client_chat_window'); + $data['js_plugin_options'] = get_js_plugin_options('client_chat_window'); + // Set user info $data['chat']['user'] = array( 'name' => htmlspecialchars(topage($thread->userName)), @@ -484,6 +484,11 @@ function setup_chatview_for_operator(Thread $thread, $operator) { $data = setup_chatview($thread); + // Load JavaScript plugins and JavaScripts, CSS files required by them + $data['additional_css'] = get_additional_css('agent_chat_window'); + $data['additional_js'] = get_additional_js('agent_chat_window'); + $data['js_plugin_options'] = get_js_plugin_options('agent_chat_window'); + // Set operator info $data['chat']['user'] = array( 'name' => htmlspecialchars(