From 67e682f4ffff42a42ead52b61f2d73bff27d0b2a Mon Sep 17 00:00:00 2001 From: Dave Shoreman Date: Sun, 25 Sep 2016 04:10:53 +0100 Subject: [PATCH] Format the formatted tab for mail logs The default markup is built by the jQuery plugin, meaning the formatted tab just shows raw data. This checks for a Message-ID: string in the source to identify email logs, and uses the unescaped content of the raw tab to show a formatted email. --- modules/system/assets/js/eventlogs/exception-beautifier.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/system/assets/js/eventlogs/exception-beautifier.js b/modules/system/assets/js/eventlogs/exception-beautifier.js index 49918bed1..2eff039e3 100644 --- a/modules/system/assets/js/eventlogs/exception-beautifier.js +++ b/modules/system/assets/js/eventlogs/exception-beautifier.js @@ -324,6 +324,10 @@ '
' + '') + if (source.indexOf('Message-ID:') > 0) { + markup = '
' + source.trim().replace(/\r\n|\r|\n/g, '
').replace(/ {2}/g, '  ') + '
' + } + tabs.find('#beautifier-tab-formatted').append(markup) tabs.find('#beautifier-tab-raw').append('
' + $.oc.escapeHtmlString(source.trim()).replace(/\r\n|\r|\n/g, '
').replace(/ {2}/g, '  ') + '
') @@ -358,4 +362,4 @@ $('[data-plugin="exception-beautifier"]').exceptionBeautifier() }) -}(window.jQuery) \ No newline at end of file +}(window.jQuery)