From 6aa0ca7a7e2f03edcd614cfa48831f67f83d58d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 5 Jun 2012 14:22:21 +0200 Subject: [IMP] mail_thread: cleaned message_get_subscribers and related methods; propagated change so that project_issue, mrp, crm_lead, project, project_task, hr_recruitment and hr_holidays now cleanly override message_get_subscribers. bzr revid: tde@openerp.com-20120605122221-nvxfxfcx5o82vkvx --- addons/mail/static/src/js/mail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/mail/static/src/js/mail.js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 1ec6fe32eb5..b604f10d1b1 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -529,7 +529,7 @@ openerp.mail = function(session) { }, fetch_subscribers: function () { - return this.ds.call('message_get_subscribers', [[this.view.datarecord.id]]).then(this.proxy('display_subscribers')); + return this.ds.call('message_read_subscribers', [[this.view.datarecord.id]]).then(this.proxy('display_subscribers')); }, display_subscribers: function (records) { -- cgit v1.2.3 From a9ccf1512c1ee048a76b8059dce23ebf72da0a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 2 Jul 2012 13:10:35 +0200 Subject: [IMP] Chatter: expander plugin used for read more/read less. bzr revid: tde@openerp.com-20120702111035-5jpi843m8mlexuer --- addons/mail/static/src/js/mail.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'addons/mail/static/src/js/mail.js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 5633a4bdae0..72facc8f3dd 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -302,17 +302,17 @@ openerp.mail = function(session) { record.body = this.do_clean_text(record.body); record.body = this.do_replace_internal_links(record.body); - // split for see more - var split = this.do_truncate_string(record.body, this.params.msg_more_limit); - record.body_head = split[0]; - record.body_tail = split[1]; - // format date according to the user timezone record.date = session.web.format_value(record.date, {type:"datetime"}); - var rendered = session.web.qweb.render('mail.Thread.message', {'record': record, 'thread': this, 'params': this.params, 'display': this.display}); - $( rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first')); + $(rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first')); + // expand feature + this.$element.find('div.oe_mail_msg_body:last').expander({ + slicePoint: this.params.msg_more_limit, + moreClass: 'oe_mail_expand', + lesClass: 'oe_mail_reduce', + }); }, /** -- cgit v1.2.3 From 8c0ad61140a9f4e7d0e27e0ebbec593ee7727898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 2 Jul 2012 14:52:18 +0200 Subject: [IMP] Chatter: expander plugin: other version of the plugin (old one was quite weird) + some cleaning. bzr revid: tde@openerp.com-20120702125218-aw1ac29zyk2q3j9b --- addons/mail/static/src/js/mail.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/mail/static/src/js/mail.js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 72facc8f3dd..8e930c5667d 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -310,6 +310,9 @@ openerp.mail = function(session) { // expand feature this.$element.find('div.oe_mail_msg_body:last').expander({ slicePoint: this.params.msg_more_limit, + expandText: 'see more', + userCollapseText: 'see less', + detailClass: 'oe_mail_msg_tail', moreClass: 'oe_mail_expand', lesClass: 'oe_mail_reduce', }); -- cgit v1.2.3 From 0c86af17ab90c580106aec65d195a91b8710e75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 2 Jul 2012 16:31:53 +0200 Subject: [CLEAN] mail: removed dead code. bzr revid: tde@openerp.com-20120702143153-dv44zpmvsyphbwy1 --- addons/mail/static/src/js/mail.js | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'addons/mail/static/src/js/mail.js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 8e930c5667d..e724a8bcbd0 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -450,20 +450,6 @@ openerp.mail = function(session) { return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || ''); }, - /** - * @param {String} string to truncate - * @param {Number} max number of chars to display - * @returns {String} truncated string - */ - do_truncate_string: function(string, max_length) { - // multiply by 1.2: prevent truncating an just too little long string - if (string.length <= (max_length * 1.2)) { - return [string, ""]; - } else { - return [string.slice(0, max_length), string.slice(max_length)]; - } - }, - /** Removes html tags, except b, em, br */ do_clean_text: function (string) { var html = $('
').text(string.replace(/\s+/g, ' ')).html().replace(new RegExp('<(/)?(b|em|br|br /)\\s*>', 'gi'), '<$1$2>'); -- cgit v1.2.3 From 59f4820da36df40009d5bae943e3e77d6efd48a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 3 Jul 2012 14:35:09 +0200 Subject: [REF] Chatter: ThreadView widget now named mail_thread. bzr revid: tde@openerp.com-20120703123509-0qvtq0sjo3ki3n7s --- addons/mail/static/src/js/mail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/mail/static/src/js/mail.js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index da54130d093..6eddd6da712 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -598,7 +598,7 @@ openerp.mail = function(session) { return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || ''); }, }); - session.web.form.widgets.add( 'ThreadView', 'openerp.mail.RecordThread'); + session.web.form.widgets.add( 'mail_thread', 'openerp.mail.RecordThread'); /** WallView widget: a wall of messages */ mail.WallView = session.web.Widget.extend({ -- cgit v1.2.3 From 27a1ac68d4443dfd08f8b15141716a8c98098faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Tue, 3 Jul 2012 14:41:11 +0200 Subject: [REF] ThreadView widget renamed to mail_thread. Also added some footers where they were not used. bzr revid: tde@openerp.com-20120703124111-smgj0kw3ct32552y --- addons/mail/static/src/js/mail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/mail/static/src/js/mail.js') diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 6eddd6da712..3c0b61c173e 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -497,7 +497,7 @@ openerp.mail = function(session) { }); session.web.form.widgets.add( 'Thread', 'openerp.mail.Thread'); - /** ThreadView widget: thread of comments */ + /** mail_thread widget: thread of comments */ mail.RecordThread = session.web.form.AbstractField.extend({ template: 'mail.RecordThread', -- cgit v1.2.3