[MERGE] forward porting fixes from saas-3
[odoo/odoo.git] / addons / im_livechat / loader.js
1
2 (function() {
3
4 var tmpQWeb2 = window.QWeb2;
5
6 require.config({
7     context: "oelivesupport",
8     baseUrl: {{url | json}},
9     paths: {
10         jquery: "im_livechat/static/ext/static/lib/jquery/jquery",
11         underscore: "im_livechat/static/ext/static/lib/underscore/underscore",
12         qweb2: "im_livechat/static/ext/static/lib/qweb/qweb2",
13         openerp: "web/static/src/js/openerpframework",
14         "jquery.achtung": "im_livechat/static/ext/static/lib/jquery-achtung/src/ui.achtung",
15         livesupport: "im_livechat/static/ext/static/js/livesupport",
16         im_common: "im/static/src/js/im_common"
17     },
18     shim: {
19         underscore: {
20             init: function() {
21                 return _.noConflict();
22             },
23         },
24         qweb2: {
25             init: function() {
26                 var QWeb2 = window.QWeb2;
27                 window.QWeb2 = tmpQWeb2;
28                 return QWeb2;
29             },
30         },
31         "jquery.achtung": {
32             deps: ['jquery'],
33         },
34     },
35 })(["livesupport", "jquery"], function(livesupport, jQuery) {
36     jQuery.noConflict();
37     console.log("loaded live support");
38     livesupport.main({{url | json}}, {{db | json}}, "public", "public", {{channel | json}}, {
39         buttonText: {{buttonText | json}},
40         inputPlaceholder: {{inputPlaceholder | json}},
41         defaultMessage: {{(defaultMessage or None) | json}},
42         auto: window.oe_im_livechat_auto || false,
43         userName: {{userName | json}} || undefined,
44     });
45 });
46
47 })();