From 4424f301a66df5e03651c5c550312bb5dfd20f4f Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 23 Nov 2015 14:13:04 +0100 Subject: [PATCH] [FIX] im_livechat: missing dependencies in im_livechat page The Website Live Chat is supposed to appear following 3 ways outside of the backend: - in a singleton page with path /im_livechat/support/{id} - in a page in which a code code snippet (with two script and a css bundle) has been inserted in the head section - by installing the module "Website Live Support" In the first both instances, including some less files and bootstrap default variables is required which this commit do. In the last instance these file should already be included in the website and the additional assets required are inserted in the website.assets_frontend bundle. opw-654898 --- .../im_livechat/static/src/less/im_livechat_bootstrap.less | 7 +++++++ addons/im_livechat/views/im_livechat_channel_templates.xml | 3 +++ addons/mail/static/src/js/chat_window.js | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 addons/im_livechat/static/src/less/im_livechat_bootstrap.less diff --git a/addons/im_livechat/static/src/less/im_livechat_bootstrap.less b/addons/im_livechat/static/src/less/im_livechat_bootstrap.less new file mode 100644 index 00000000000..83c3bfb7757 --- /dev/null +++ b/addons/im_livechat/static/src/less/im_livechat_bootstrap.less @@ -0,0 +1,7 @@ +// bootstrap variables needed for embedding of im_livechat outside website +@gray-light: lighten(#000, 46.7%); // #777 +@gray-lighter: lighten(#000, 93.5%); // #eee +@screen-xs-max: 767px; +.text-muted { + color: @gray-light; +} diff --git a/addons/im_livechat/views/im_livechat_channel_templates.xml b/addons/im_livechat/views/im_livechat_channel_templates.xml index 19882bcb34e..cfcddf9f8d8 100644 --- a/addons/im_livechat/views/im_livechat_channel_templates.xml +++ b/addons/im_livechat/views/im_livechat_channel_templates.xml @@ -128,6 +128,9 @@ + + + diff --git a/addons/mail/static/src/js/chat_window.js b/addons/mail/static/src/js/chat_window.js index 8fa1e2a2536..3936ef956e1 100644 --- a/addons/mail/static/src/js/chat_window.js +++ b/addons/mail/static/src/js/chat_window.js @@ -76,7 +76,8 @@ return Widget.extend({ this.fold(); }, on_keydown: function (event) { - if (event.which === $.ui.keyCode.ENTER) { + // ENTER key (avoid requiring jquery ui for external livechat) + if (event.which === 13) { var message = { content: this.$input.val(), attachment_ids: [],