Fixed a lot of stuff to make it work again in live support
bzr revid: nicolas.vanhoren@openerp.com-20130820144147-gnc26ul3ql86qfzs
This commit is contained in:
parent
980952c416
commit
124b93b0c1
|
@ -105,160 +105,3 @@
|
|||
vertical-align: middle;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/* conversations */
|
||||
|
||||
.openerp .oe_im_chatview {
|
||||
position: fixed;
|
||||
overflow: hidden;
|
||||
bottom: 6px;
|
||||
margin-right: 6px;
|
||||
background: rgba(60, 60, 60, 0.8);
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-moz-box-shadow: 0 0 3px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.3);
|
||||
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 0 3px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.3);
|
||||
width: 240px;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_disconnected {
|
||||
display:none;
|
||||
z-index: 100;
|
||||
width: 100%;
|
||||
background: #E8EBEF;
|
||||
padding: 5px;
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
line-height: 14px;
|
||||
height: 28px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.openerp .oe_im_chatview.oe_im_chatview_disconnected_status .oe_im_chatview_disconnected {
|
||||
display: block;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_header {
|
||||
padding: 3px 6px 2px;
|
||||
background: #DEDEDE;
|
||||
background: -moz-linear-gradient(#FCFCFC, #DEDEDE);
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#FCFCFC), to(#DEDEDE));
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0;
|
||||
border-bottom: 1px solid #AEB9BD;
|
||||
cursor: pointer;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_close {
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
-webkit-appearance: none;
|
||||
font-size: 18px;
|
||||
line-height: 16px;
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
text-shadow: 0 1px 0 white;
|
||||
opacity: 0.2;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_content {
|
||||
overflow: auto;
|
||||
height: 287px;
|
||||
}
|
||||
.openerp .oe_im_chatview.oe_im_chatview_disconnected_status .oe_im_chatview_content {
|
||||
height: 249px;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_footer {
|
||||
position: relative;
|
||||
padding: 3px;
|
||||
border-top: 1px solid #AEB9BD;
|
||||
background: #DEDEDE;
|
||||
background: -moz-linear-gradient(#FCFCFC, #DEDEDE);
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#FCFCFC), to(#DEDEDE));
|
||||
-moz-border-radius: 0 0 3px 3px;
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_input {
|
||||
width: 222px;
|
||||
font-family: Lato, Helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
padding: 1px 5px;
|
||||
border: 1px solid #AEB9BD;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-moz-box-shadow: inset 0 1px 4px rgba(0,0,0,0.2);
|
||||
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_bubble {
|
||||
background: white;
|
||||
position: relative;
|
||||
padding: 3px;
|
||||
margin: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_clip {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
margin-right: 4px;
|
||||
-moz-box-shadow: 0 0 2px 1px rgba(0,0,0,0.25);
|
||||
-webkit-box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25);
|
||||
box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_avatar {
|
||||
float: left;
|
||||
width: 26px;
|
||||
height: auto;
|
||||
clip: rect(0, 26px, 26px, 0);
|
||||
max-width: 100%;
|
||||
width: auto 9;
|
||||
height: auto;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
-ms-interpolation-mode: bicubic;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_time {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
margin: 3px;
|
||||
text-align: right;
|
||||
line-height: 13px;
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
width: 60px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_from {
|
||||
margin: 0 0 2px 0;
|
||||
line-height: 14px;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
width: 140px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
color: #3A87AD;
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_bubble_list {
|
||||
}
|
||||
.openerp .oe_im_chatview .oe_im_chatview_bubble_item {
|
||||
margin: 0 0 2px 30px;
|
||||
line-height: 14px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.openerp .oe_im_chatview_online {
|
||||
display: none;
|
||||
margin-top: -4px;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
openerp.im = function(instance) {
|
||||
|
||||
var USERS_LIMIT = 20;
|
||||
var ERROR_DELAY = 5000;
|
||||
|
||||
var _t = instance.web._t;
|
||||
var QWeb = instance.web.qweb;
|
||||
|
|
|
@ -126,7 +126,7 @@ function declare($, _, openerp) {
|
|||
});
|
||||
}
|
||||
|
||||
auth_def.then(function() {
|
||||
return auth_def.then(function() {
|
||||
self.my_id = user_id;
|
||||
return self.ensure_users([self.my_id]);
|
||||
}).then(function() {
|
||||
|
|
|
@ -27,37 +27,4 @@
|
|||
<img t-att-src="_s +'/im/static/src/img/green.png'" class="oe_im_user_online"/>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="Conversation">
|
||||
<div class="oe_im_chatview">
|
||||
<div class="oe_im_chatview_header">
|
||||
<img t-att-src="_s +'/im/static/src/img/green.png'" class="oe_im_chatview_online"/>
|
||||
<t t-esc="widget.user.get('name') || 'Anonymous'"/>
|
||||
<scan class="oe_im_chatview_nbr_messages" />
|
||||
<button class="oe_im_chatview_close">×</button>
|
||||
</div>
|
||||
<div class="oe_im_chatview_disconnected">
|
||||
<t t-esc='_.str.sprintf(_t("%s is offline. He/She will receive your messages on his/her next connection."), widget.user.get("name") || "Anonymous")'/>
|
||||
</div>
|
||||
<div class="oe_im_chatview_content">
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="oe_im_chatview_footer">
|
||||
<input class="oe_im_chatview_input" t-att-placeholder="_t('Say something...')" />
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
<t t-name="Conversation.bubble">
|
||||
<div class="oe_im_chatview_bubble">
|
||||
<div class="oe_im_chatview_clip">
|
||||
<img class="oe_im_chatview_avatar" t-att-src='user.get("image_url")'/>
|
||||
</div>
|
||||
<div class="oe_im_chatview_from"><t t-esc="user.get('name') || 'Anonymous'"/></div>
|
||||
<div class="oe_im_chatview_bubble_list">
|
||||
<t t-foreach="items" t-as="item">
|
||||
<div class="oe_im_chatview_bubble_item"><t t-esc="item"/></div>
|
||||
</t>
|
||||
</div>
|
||||
<div class="oe_im_chatview_time"><t t-esc="time"/></div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
|
@ -4,7 +4,8 @@
|
|||
<t t-name="im_common.conversation">
|
||||
<div class="oe_im_chatview_header">
|
||||
<img t-att-src="to_url('im/static/src/img/green.png')" class="oe_im_chatview_online"/>
|
||||
<t t-esc="widget.user.get('name') || _t('You')"/>
|
||||
<t t-esc="widget.user.get('name')"/>
|
||||
<scan class="oe_im_chatview_nbr_messages" />
|
||||
<button class="oe_im_chatview_close">×</button>
|
||||
</div>
|
||||
<div class="oe_im_chatview_disconnected">
|
||||
|
@ -23,7 +24,7 @@
|
|||
<div class="oe_im_chatview_clip">
|
||||
<img class="oe_im_chatview_avatar" t-att-src="user.get('image_url')"/>
|
||||
</div>
|
||||
<div class="oe_im_chatview_from"><t t-esc="user.get('name') || _t('You')"/></div>
|
||||
<div class="oe_im_chatview_from"><t t-esc="user.get('name')"/></div>
|
||||
<div class="oe_im_chatview_bubble_list">
|
||||
<t t-foreach="items" t-as="item">
|
||||
<div class="oe_im_chatview_bubble_item"><t t-esc="item"/></div>
|
||||
|
|
|
@ -13,7 +13,6 @@ define(["openerp", "im_common", "underscore", "require", "jquery",
|
|||
var livesupport = {};
|
||||
|
||||
livesupport.main = function(server_url, db, login, password, channel, options) {
|
||||
var defs = [];
|
||||
options = options || {};
|
||||
_.defaults(options, {
|
||||
buttonText: _t("Chat with one of our collaborators"),
|
||||
|
@ -25,22 +24,24 @@ define(["openerp", "im_common", "underscore", "require", "jquery",
|
|||
});
|
||||
|
||||
im_common.notification = notification;
|
||||
im_common.to_url = require.toUrl;
|
||||
defs.push(add_css("im/static/src/css/im_common.css"));
|
||||
defs.push(add_css("im_livechat/static/ext/static/lib/jquery-achtung/src/ui.achtung.css"));
|
||||
//im_common.to_url = require.toUrl;
|
||||
|
||||
return $.when.apply($, defs).then(function() {
|
||||
console.log("starting live support customer app");
|
||||
im_common.connection = new openerp.Session(null, server_url, { override_session: true });
|
||||
return im_common.connection.session_authenticate(db, login, password);
|
||||
}).then(function() {
|
||||
return im_common.connection.rpc('/web/proxy/load', {path: '/im_livechat/static/ext/static/js/livechat.xml'}).then(function(xml) {
|
||||
console.log("starting live support customer app");
|
||||
im_common.connection = new openerp.Session(null, server_url, { override_session: true });
|
||||
return im_common.connection.session_authenticate(db, login, password).then(function() {
|
||||
im_common.to_url = function(file) {
|
||||
return im_common.connection.url("/" + file);
|
||||
};
|
||||
var defs = [];
|
||||
defs.push(add_css("im/static/src/css/im_common.css"));
|
||||
defs.push(add_css("im_livechat/static/ext/static/lib/jquery-achtung/src/ui.achtung.css"));
|
||||
defs.push(im_common.connection.rpc('/web/proxy/load', {path: '/im_livechat/static/ext/static/js/livechat.xml'}).then(function(xml) {
|
||||
openerp.qweb.add_template(xml);
|
||||
});
|
||||
}).then(function() {
|
||||
return im_common.connection.rpc('/web/proxy/load', {path: '/im/static/src/xml/im_common.xml'}).then(function(xml) {
|
||||
}));
|
||||
defs.push(im_common.connection.rpc('/web/proxy/load', {path: '/im/static/src/xml/im_common.xml'}).then(function(xml) {
|
||||
openerp.qweb.add_template(xml);
|
||||
});
|
||||
}));
|
||||
return $.when.apply($, defs);
|
||||
}).then(function() {
|
||||
return im_common.connection.rpc("/im_livechat/available", {db: db, channel: channel}).then(function(activated) {
|
||||
if (! activated & ! options.auto)
|
||||
|
|
Loading…
Reference in New Issue