mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-07 14:28:52 +00:00
Monotone-Parent: ab761b97d51a70312fa6548a0c618be9ab0a93e9
Monotone-Revision: ae0217b86030920b5df7ca27fd75ef3aaed08ade Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-02-26T16:37:59 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2007-02-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* 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 <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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"
|
||||
><var:string value="flatContentAsString" const:escapeHTML="NO" /></div>
|
||||
|
||||
Reference in New Issue
Block a user