From 229096453c6fed151ab5edebffa4fcee42263110 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 19 Aug 2012 18:50:39 +0200 Subject: [PATCH] [IMP] remove formatting code and unused method bzr revid: fp@openerp.com-20120819165039-kgs71kkn436753tz --- addons/mail/mail_thread.py | 12 +--------- addons/mail/static/src/js/mail.js | 39 ------------------------------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 6c9d4dc3904..615dcf9c306 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -251,6 +251,7 @@ class mail_thread(osv.Model): Please see message_search for more information about the parameters. """ + print 'MSG READ', uid, ids, fetch_ancestors, ancestor_ids, limit, offset, domain, context message_ids = self.message_search(cr, uid, ids, fetch_ancestors, ancestor_ids, limit, offset, domain, context=context) messages = self.pool.get('mail.message').read(cr, uid, message_ids, context=context) @@ -753,17 +754,6 @@ class mail_thread(osv.Model): # Subscription mechanism #------------------------------------------------------ - # FP Note: replaced by message_follower_ids - # def message_get_followers(self, cr, uid, ids, context=None): - - def message_read_followers(self, cr, uid, ids, fields=['id', 'name', 'image_small'], context=None): - """ Returns the current document followers as a read result. Used - mainly for Chatter having only one method to call to have - details about users. - """ - user_ids = self.message_get_followers(cr, uid, ids, context=context) - return self.pool.get('res.users').read(cr, uid, user_ids, fields=fields, context=context) - def message_is_follower(self, cr, uid, ids, user_id = None, context=None): """ Check if uid or user_id (if set) is a follower to the current document. diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 9612f73a6b8..a6d6f17958e 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -164,18 +164,6 @@ openerp.mail = function(session) { * 5. 'My Label' */ - /** Removes html tags, except b, em, br, ul, li */ - do_text_remove_html_tags: function (string) { - var html = $('
').text(string.replace(/\s+/g, ' ')).html().replace(new RegExp('<(/)?(b|em|br|br /|ul|li|div)\\s*>', 'gi'), '<$1$2>'); - return html; - }, - - /** Replaces line breaks by html line breaks (br) */ - do_text_nl2br: function (str, is_xhtml) { - var break_tag = (is_xhtml || typeof is_xhtml === 'undefined') ? '
' : '
'; - return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ break_tag +'$2'); - }, - /* Add a prefix before each new line of the original string */ do_text_quote: function (str, prefix) { return str.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1'+ break_tag +'$2' + prefix || '> '); @@ -191,28 +179,6 @@ openerp.mail = function(session) { do_replace_expressions: function (string) { var self = this; var icon_list = ['al', 'pinky'] - /* shortcut to user: @login */ - var regex_login = new RegExp(/(^|\s)@((\w|@|\.)*)/g); - var regex_res = regex_login.exec(string); - while (regex_res != null) { - var login = regex_res[2]; - string = string.replace(regex_res[0], regex_res[1] + '@' + login + ''); - regex_res = regex_login.exec(string); - } - /* shortcut for internal document */ - var regex_login = new RegExp(/(^|\s)\[(\w+).(\w+),(\d)\|*((\w|[@ .,])*)\]/g); - var regex_res = regex_login.exec(string); - while (regex_res != null) { - var res_model = regex_res[2] + '.' + regex_res[3]; - var res_id = regex_res[4]; - if (! regex_res[5]) { - var label = res_model + ':' + res_id } - else { - var label = regex_res[5]; - } - string = string.replace(regex_res[0], regex_res[1] + '