Skip to content

Commit

Permalink
added configurable option for header blue line border
Browse files Browse the repository at this point in the history
  • Loading branch information
jeevatkm committed Oct 19, 2018
1 parent 3cc0aad commit 181f41e
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 50 deletions.
3 changes: 2 additions & 1 deletion ReplyWithHeader/MHConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@
#define MHSubjectPrefixTextEnabled @"MHSubjectPrefixTextEnabled"
#define MHRawHeadersEnabled @"MHRawHeadersEnabled"
#define MHBundleHeaderLanguageCode @"MHBundleHeaderLanguageCode"
#define MHHeaderBlueLineBorderEnabled @"MHHeaderBlueLineBorderEnabled"

#define MHPreferencesNibName @"MHPreferencesView"
#define MHPreferencesNibName @"MHPreferences"

#define MHLogEnabled @"MHDebugLog"

Expand Down
1 change: 1 addition & 0 deletions ReplyWithHeader/MHQuotedMailOriginal.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
@private
id document;
DOMDocumentFragment *headerBorder;
DOMDocumentFragment *headerBorderSpacer;
BOOL isHTMLMail;
DOMHTMLDivElement *originalEmail;
int textNodeLocation; //which
Expand Down
19 changes: 17 additions & 2 deletions ReplyWithHeader/MHQuotedMailOriginal.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,26 @@ - (void)insertForHTMLMail:(DOMDocumentFragment *)headerFragment
{
DOMNode *nodeRef = [self getBlockquoteTagNode];
[nodeRef insertBefore:headerFragment refChild:[nodeRef firstChild]];
[nodeRef insertBefore:headerBorder refChild:[nodeRef firstChild]];
if (GET_DEFAULT_BOOL(MHHeaderBlueLineBorderEnabled))
{
[nodeRef insertBefore:headerBorder refChild:[nodeRef firstChild]];
}
else
{
[nodeRef insertBefore:headerBorderSpacer refChild:[nodeRef firstChild]];
}
}
else
{
[originalEmail insertBefore:headerFragment refChild: [originalEmail firstChild]];
[originalEmail insertBefore:headerBorder refChild: [originalEmail firstChild]];
if (GET_DEFAULT_BOOL(MHHeaderBlueLineBorderEnabled))
{
[originalEmail insertBefore:headerBorder refChild: [originalEmail firstChild]];
}
else
{
[originalEmail insertBefore:headerBorderSpacer refChild: [originalEmail firstChild]];
}
}
}

Expand Down Expand Up @@ -255,6 +269,7 @@ - (void)initVars

// now initialze header border string into html form
headerBorder = [self createDocumentFragment:borderString];
headerBorderSpacer = [self createDocumentFragment:@"<br><br>"];

textNodeLocation = 0;
}
Expand Down
1 change: 1 addition & 0 deletions ReplyWithHeader/MailHeader.m
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ + (void)assignUserDefaults
[NSArchiver archivedDataWithRootObject:[NSColor blackColor]], MHHeaderColor,
[NSNumber numberWithBool:NO], MHSubjectPrefixTextEnabled,
[NSNumber numberWithBool:NO], MHRawHeadersEnabled,
[NSNumber numberWithBool:YES], MHHeaderBlueLineBorderEnabled,
[NSNumber numberWithBool:NO], MHRemoveSignatureEnabled,
[NSNumber numberWithInt:1], MHHeaderAttributionFromTagStyle,
[NSNumber numberWithInt:1], MHHeaderAttributionToCcTagStyle,
Expand Down
Loading

0 comments on commit 181f41e

Please sign in to comment.