mirror of
https://gitlab.com/ric_harvey/MailHog.git
synced 2024-12-17 18:07:16 +00:00
parent
bb46bac58f
commit
66ca91749f
2 changed files with 16 additions and 1 deletions
|
@ -163,6 +163,21 @@ mailhogApp.controller('MailCtrl', function ($scope, $http, $sce, $timeout) {
|
|||
}, 10);
|
||||
}
|
||||
|
||||
$scope.tryDecodeContent = function(message, content) {
|
||||
var charset = "UTF-8"
|
||||
if(message.Content.Headers["Content-Type"][0]) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
if(message.Content.Headers["Content-Transfer-Encoding"][0]) {
|
||||
if(message.Content.Headers["Content-Transfer-Encoding"][0] == "quoted-printable") {
|
||||
content = unescapeFromQuotedPrintable(content, charset)
|
||||
}
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
$scope.getMessagePlain = function(message) {
|
||||
var l = $scope.findMatchingMIME(message, "text/plain");
|
||||
if(l != null && l !== "undefined") {
|
||||
|
|
|
@ -228,7 +228,7 @@
|
|||
</ul>
|
||||
<div class="tab-content">
|
||||
<div ng-if="hasHTML(preview)" ng-class="{ active: hasHTML(preview) }" class="tab-pane" id="preview-html" ng-bind-html="preview.previewHTML"></div>
|
||||
<div class="tab-pane" ng-class="{ active: !hasHTML(preview) }" id="preview-plain">{{ getMessagePlain(preview) }}</div>
|
||||
<div class="tab-pane" ng-class="{ active: !hasHTML(preview) }" id="preview-plain">{{ tryDecodeContent(preview, getMessagePlain(preview)) }}</div>
|
||||
<div class="tab-pane" id="preview-source">{{ getSource(preview) }}</div>
|
||||
<div class="tab-pane" id="preview-mime">
|
||||
<div ng-repeat="part in preview.MIME.Parts" class="mime-part">
|
||||
|
|
Loading…
Reference in a new issue