From a74c91742ab36503d472c3879c985b8827d2a4ec Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 27 Dec 2018 12:55:52 +0530 Subject: [PATCH] fix(formatting): for email replies (#6676) * fix(fomratting): for email replies * fix(timeline): some more testing and fixes * fix(style): for blockquotes, also feedback --- .../public/js/frappe/form/footer/timeline.js | 3 +- .../public/js/frappe/views/communication.js | 33 ++++++++++++------- frappe/public/less/form.less | 5 ++- frappe/public/less/quill.less | 6 ++++ 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/frappe/public/js/frappe/form/footer/timeline.js b/frappe/public/js/frappe/form/footer/timeline.js index 0782f57b91..44771dd7c5 100644 --- a/frappe/public/js/frappe/form/footer/timeline.js +++ b/frappe/public/js/frappe/form/footer/timeline.js @@ -2,6 +2,7 @@ // MIT License. See license.txt frappe.provide('frappe.timeline'); +frappe.separator_element = '
---
'; frappe.ui.form.Timeline = class Timeline { constructor(opts) { @@ -344,7 +345,7 @@ frappe.ui.form.Timeline = class Timeline { }); } else { if(c.communication_type=="Communication" && c.communication_medium=="Email") { - c.content = c.content.split('')[0]; + c.content = c.content.split(frappe.separator_element)[0]; c.content = frappe.utils.strip_original_content(c.content); c.original_content = c.content; diff --git a/frappe/public/js/frappe/views/communication.js b/frappe/public/js/frappe/views/communication.js index 46f25bc23b..95fef7cf5a 100755 --- a/frappe/public/js/frappe/views/communication.js +++ b/frappe/public/js/frappe/views/communication.js @@ -11,6 +11,7 @@ frappe.views.CommunicationComposer = Class.extend({ }, make: function() { var me = this; + this.dialog = new frappe.ui.Dialog({ title: (this.title || this.subject || __("New Email")), no_submit_on_enter: true, @@ -499,7 +500,7 @@ frappe.views.CommunicationComposer = Class.extend({ if (this.dialog) { try { let message = this.dialog.get_value('content'); - message = message.split('')[0]; + message = message.split(frappe.separator_element)[0]; localStorage.setItem(this.frm.doctype + this.frm.docname, message); } catch (e) { // silently fail @@ -656,9 +657,9 @@ frappe.views.CommunicationComposer = Class.extend({ let last_email_content = last_email.original_comment || last_email.content; - last_email_content = last_email_content - .replace(/<meta[\s\S]*meta>/g, '') // remove tags - .replace(/<style[\s\S]*<\/style>/g, ''); // // remove