From 55c1e4f5e2efce57fada2ec1ff4d1814f8d968fe Mon Sep 17 00:00:00 2001 From: wolfgang Date: Fri, 2 Mar 2007 22:28:57 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1030 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 8 ++ UI/MailPartViewers/UIxMailPartHTMLViewer.m | 54 +++----- UI/Templates/ContactsUI/UIxContactView.wox | 125 +++++++++--------- .../MailPartViewers/UIxMailPartHTMLViewer.wox | 2 +- UI/WebServerResources/event-gradient.png | Bin 0 -> 1312 bytes 5 files changed, 93 insertions(+), 96 deletions(-) create mode 100644 UI/WebServerResources/event-gradient.png diff --git a/ChangeLog b/ChangeLog index 711bd874..f9685041 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-02-26 Wolfgang Sourdeau + + * UI/MailPartViewers/UIxMailPartHTMLViewer.m + ([_UIxHTMLMailContentHandler -_appendStyle:_charslength:_len]): + don't prepend anything to the class and id named. Instead, we + make each style embedded in the ".SOGoHTMLMail-CSS-Delimiter" + class. + 2007-02-21 Wolfgang Sourdeau * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject diff --git a/UI/MailPartViewers/UIxMailPartHTMLViewer.m b/UI/MailPartViewers/UIxMailPartHTMLViewer.m index 4b926e1e..5203d85e 100644 --- a/UI/MailPartViewers/UIxMailPartHTMLViewer.m +++ b/UI/MailPartViewers/UIxMailPartHTMLViewer.m @@ -42,6 +42,7 @@ BOOL inStyle; BOOL inScript; BOOL inCSSDeclaration; + BOOL hasEmbeddedCSS; NSMutableArray *crumb; } @@ -107,6 +108,7 @@ inStyle = NO; inScript = NO; inCSSDeclaration = NO; + hasEmbeddedCSS = NO; } - (void) endDocument @@ -133,26 +135,6 @@ showWhoWeAre(); } -- (NSString *) _valueForCSSIdentifier: (NSString *) primaryValue -{ - NSMutableString *value; - NSEnumerator *classes; - NSString *currentValue; - - value = [NSMutableString new]; - [value autorelease]; - - classes = [[primaryValue componentsSeparatedByString: @" "] objectEnumerator]; - currentValue = [classes nextObject]; - while (currentValue) - { - [value appendFormat: @"SOGoHTMLMail-%@ ", currentValue]; - currentValue = [classes nextObject]; - } - - return value; -} - - (void) _appendStyle: (unichar *) _chars length: (int) _len { @@ -167,24 +149,35 @@ if (inCSSDeclaration) { if (*(char *) currentChar == '}') - inCSSDeclaration = NO; + { + inCSSDeclaration = NO; + hasEmbeddedCSS = NO; + } } else { if (*(char *) currentChar == '{') inCSSDeclaration = YES; - else if (*(char *) currentChar == '.' - || *(char *) currentChar == '#') + if (*(char *) currentChar == ',') + hasEmbeddedCSS = NO; + else if (!hasEmbeddedCSS) { - [css appendString: [NSString stringWithCharacters: start - length: (currentChar - start + 1)]]; - [css appendString: @"SOGoHTMLMail-"]; - start = currentChar + 1; + if (*(char *) currentChar == '@') + hasEmbeddedCSS = YES; + else + if (*(char *) currentChar > 32) + { + [css appendString: [NSString stringWithCharacters: start + length: (currentChar - start)]]; + [css appendString: @".SOGoHTMLMail-CSS-Delimiter "]; + hasEmbeddedCSS = YES; + start = currentChar; + } } } } [css appendString: [NSString stringWithCharacters: start - length: (currentChar - start + 1)]]; + length: (currentChar - start)]]; } - (void) startElement: (NSString *) _localName @@ -215,10 +208,7 @@ { skipAttribute = NO; name = [_attributes nameAtIndex: count]; - if ([name caseInsensitiveCompare: @"class"] == NSOrderedSame - || [name caseInsensitiveCompare: @"id"] == NSOrderedSame) - value = [self _valueForCSSIdentifier: [_attributes valueAtIndex: count]]; - else if ([[name lowercaseString] hasPrefix: @"on"]) + if ([[name lowercaseString] hasPrefix: @"on"]) skipAttribute = YES; else if ([name caseInsensitiveCompare: @"src"] == NSOrderedSame) { diff --git a/UI/Templates/ContactsUI/UIxContactView.wox b/UI/Templates/ContactsUI/UIxContactView.wox index 934ca7b5..7d3e078d 100644 --- a/UI/Templates/ContactsUI/UIxContactView.wox +++ b/UI/Templates/ContactsUI/UIxContactView.wox @@ -9,67 +9,66 @@ className="UIxPageFrame" title="name" const:popup="YES" - > -

- -
-
-

- - - - - -
- - -
-

- - - - - - -
-
- - -
-

- - - -
-
-
- -
- -
-

- - - - - -
-
- - -
-

- - - - - - - - - -
-
-
- + >

diff --git a/UI/Templates/MailPartViewers/UIxMailPartHTMLViewer.wox b/UI/Templates/MailPartViewers/UIxMailPartHTMLViewer.wox index bafb0547..ba3db2f0 100644 --- a/UI/Templates/MailPartViewers/UIxMailPartHTMLViewer.wox +++ b/UI/Templates/MailPartViewers/UIxMailPartHTMLViewer.wox @@ -5,5 +5,5 @@ xmlns:const="http://www.skyrix.com/od/constant" xmlns:rsrc="OGo:url" xmlns:label="OGo:label" - class="mailer_htmlcontent" + class="mailer_htmlcontent SOGoHTMLMail-CSS-Delimiter" > diff --git a/UI/WebServerResources/event-gradient.png b/UI/WebServerResources/event-gradient.png new file mode 100644 index 0000000000000000000000000000000000000000..86d169c5f1c433e391d5aa708ba8f29cf26c08ee GIT binary patch literal 1312 zcmV+*1>gFKP)6-3^~UelJfun03CEiSad^gZEa<4bO1wgWnpw>WFU8GbZ8({Xk{QrNlj4iWF>9@ z00eYNL_t(|UhSLfPUSERgnfYbf938UT-@o**g1rYw0zQvHgOz#oTQ~_BmVf~kN=s+ zaU3rZ@#qXUa>UwvtM-iQ<9Pr1h=_Q5|A&+0J^rkyF?jEMRF02JJFX_6d|r|)Z8+w5 zi-^~_!-B#4&N;RxwGu3`w3+myEt`jNj(v-Wm%IsHwTi0DBmgA>-mlD?Fh7ZEJK|k{ zS7J0#7{M_S-ab*bYQ9eNrDEU~=#osEh;>m^TjxWu#djxwbI>|3bheXZc5(5WX8=rG>j|s&Tgb=Y1YGjC-`GB534JC}Ch)507n`~QYGP=JlPNJ07i7YOWK8TZ_A&Jg zU}|DJCXP&!WIojDQ35B^ajK}dLof$1V^&ohhm~+EWGW`}Srb?HZrpjT-UJg>Q3Qik z{fS!zDsZ&|oDat%;^S3#W#D(vC5#n*I__=->;#wUuYd`FOAujuE@GbCS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