Skip to content

Commit

Permalink
Merge pull request facebookarchive#616 from facebook/development
Browse files Browse the repository at this point in the history
Release Three20 v1.0.7
  • Loading branch information
jwang committed Jul 21, 2011
2 parents 300db17 + f963e02 commit 41bdb73
Show file tree
Hide file tree
Showing 57 changed files with 2,909 additions and 567 deletions.
Empty file removed Build/ignoreme
Empty file.
22 changes: 17 additions & 5 deletions samples/Style/TTCSSStyleSheets/Classes/StyleSheetViewController.m
Expand Up @@ -17,6 +17,7 @@
#import "StyleSheetViewController.h"

#import "SampleCSSStyleSheet.h"
#import "extThree20CSSStyle/TTCSSRuleSet.h"


///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -50,23 +51,34 @@ - (void)loadView {
}

self.title = @"Three20 CSS extension";
self.view.backgroundColor = TTCSS(@"body", backgroundColor);
self.view.backgroundColor = TTCSS( @"body", background_color );

// Using helper macro
UILabel* headerLabel = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel.text = @"Header text";

// When using TTCSS you specify the Rule Set Name and the CSS property.
headerLabel.font = TTCSS(@"h1", font);
headerLabel.textColor = TTCSS(@"h1", color);
headerLabel.backgroundColor = TTCSS(@"h1", backgroundColor);
headerLabel.shadowColor = TTCSS(@"h1", shadowColor);
headerLabel.shadowOffset = TTCSS(@"h1", shadowOffset);
headerLabel.backgroundColor = TTCSS(@"h1", background_color);

// Some CSS property have sub properties.
headerLabel.shadowColor = TTCSS(@"h1", text_shadow).shadowColor;
headerLabel.shadowOffset = TTCSS(@"h1", text_shadow).shadowOffset;

[headerLabel sizeToFit];
[self.view addSubview:headerLabel];

// Using UILabel addition
UILabel* headerLabel2 = [[UILabel alloc] initWithFrame:CGRectZero];
headerLabel2.text = @"Header 2 text";
[headerLabel2 applyCssSelector:@"h2"];

// Use the Helper Function TTApplyCSS and specify the Rule Set Name then the object to apply.
TTApplyCSS( @"h2", headerLabel2 );

// This will work too!
[headerLabel applyCssSelector:@"h2"];

[headerLabel2 sizeToFit];
CGFloat top = headerLabel.frame.size.height;
CGRect frame = headerLabel2.frame;
Expand Down
Expand Up @@ -33,6 +33,20 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
187835D313D5F7C2004600D3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6E3793D711B9B59D0011C497 /* Three20Network.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 662D81EF12630516005851C2;
remoteInfo = "Three20Network-Xcode3.2.5";
};
187835D513D5F7C2004600D3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6E3793D711B9B59D0011C497 /* Three20Network.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 662D81B2126304EB005851C2;
remoteInfo = "Three20NetworkUnitTests-Xcode3.2.5";
};
6E036BCC11B38E520025E8EE /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6E036BC711B38E520025E8EE /* extThree20CSSStyle.xcodeproj */;
Expand Down Expand Up @@ -355,7 +369,9 @@
isa = PBXGroup;
children = (
6E3793EF11B9B59D0011C497 /* libThree20Network.a */,
187835D413D5F7C2004600D3 /* libThree20Network-Xcode3.2.5.a */,
6E3793F111B9B59D0011C497 /* NetworkUnitTests.octest */,
187835D613D5F7C2004600D3 /* NetworkUnitTests-Xcode3.2.5.octest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -546,6 +562,20 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
187835D413D5F7C2004600D3 /* libThree20Network-Xcode3.2.5.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libThree20Network-Xcode3.2.5.a";
remoteRef = 187835D313D5F7C2004600D3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
187835D613D5F7C2004600D3 /* NetworkUnitTests-Xcode3.2.5.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "NetworkUnitTests-Xcode3.2.5.octest";
remoteRef = 187835D513D5F7C2004600D3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6E036BCD11B38E520025E8EE /* libextThree20CSSStyle.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down
36 changes: 20 additions & 16 deletions samples/TTCatalog/Classes/LauncherViewTestController.m
Expand Up @@ -28,40 +28,44 @@ - (void)loadView {
_launcherView.backgroundColor = [UIColor blackColor];
_launcherView.delegate = self;
_launcherView.columnCount = 4;
_launcherView.pages = [NSArray arrayWithObjects:
[NSArray arrayWithObjects:
[[[TTLauncherItem alloc] initWithTitle:@"Button 1"
_launcherView.persistenceMode = TTLauncherPersistenceModeAll;

if (![_launcherView restoreLauncherItems]) {
_launcherView.pages = [NSArray arrayWithObjects:
[NSArray arrayWithObjects:
[[[TTLauncherItem alloc] initWithTitle:@"Button 1"
image:@"bundle://Icon.png"
URL:nil canDelete:YES] autorelease],
[[[TTLauncherItem alloc] initWithTitle:@"Button 2"
[[[TTLauncherItem alloc] initWithTitle:@"Button 2"
image:@"bundle://Icon.png"
URL:nil canDelete:YES] autorelease],
[[[TTLauncherItem alloc] initWithTitle:@"Button 3"
[[[TTLauncherItem alloc] initWithTitle:@"Button 3"
image:@"bundle://Icon.png"
URL:@"fb://item3" canDelete:YES] autorelease],
[[[TTLauncherItem alloc] initWithTitle:@"Button 4"
[[[TTLauncherItem alloc] initWithTitle:@"Button 4"
image:@"bundle://Icon.png"
URL:@"fb://item4" canDelete:YES] autorelease],
[[[TTLauncherItem alloc] initWithTitle:@"Button 5"
[[[TTLauncherItem alloc] initWithTitle:@"Button 5"
image:@"bundle://Icon.png"
URL:@"fb://item5" canDelete:YES] autorelease],
[[[TTLauncherItem alloc] initWithTitle:@"Button 6"
[[[TTLauncherItem alloc] initWithTitle:@"Button 6"
image:@"bundle://Icon.png"
URL:@"fb://item6" canDelete:YES] autorelease],
[[[TTLauncherItem alloc] initWithTitle:@"Button 7"
[[[TTLauncherItem alloc] initWithTitle:@"Button 7"
image:@"bundle://Icon.png"
URL:@"fb://item7" canDelete:YES] autorelease],
nil],
[NSArray arrayWithObjects:
[[[TTLauncherItem alloc] initWithTitle:@"Button 8"
nil],
[NSArray arrayWithObjects:
[[[TTLauncherItem alloc] initWithTitle:@"Button 8"
image:@"bundle://Icon.png"
URL:nil canDelete:YES] autorelease],
[[[TTLauncherItem alloc] initWithTitle:@"Button 9"
[[[TTLauncherItem alloc] initWithTitle:@"Button 9"
image:@"bundle://Icon.png"
URL:nil canDelete:YES] autorelease],
nil],
nil
];
nil],
nil
];
}
[self.view addSubview:_launcherView];

TTLauncherItem* item = [_launcherView itemWithURL:@"fb://item3"];
Expand Down
30 changes: 30 additions & 0 deletions src/Three20/Three20.xcodeproj/project.pbxproj
Expand Up @@ -20,6 +20,20 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
18C011EC13D5EE01006DFF7A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 662D81EF12630516005851C2;
remoteInfo = "Three20Network-Xcode3.2.5";
};
18C011EE13D5EE01006DFF7A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6EE7389D1184ADB400A35176 /* Three20Network.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 662D81B2126304EB005851C2;
remoteInfo = "Three20NetworkUnitTests-Xcode3.2.5";
};
66FC2E291265264C00F56B19 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
Expand Down Expand Up @@ -362,7 +376,9 @@
isa = PBXGroup;
children = (
6EE738A31184ADB400A35176 /* libThree20Network.a */,
18C011ED13D5EE01006DFF7A /* libThree20Network-Xcode3.2.5.a */,
6EE738A51184ADB400A35176 /* NetworkUnitTests.octest */,
18C011EF13D5EE01006DFF7A /* NetworkUnitTests-Xcode3.2.5.octest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -487,6 +503,20 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
18C011ED13D5EE01006DFF7A /* libThree20Network-Xcode3.2.5.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libThree20Network-Xcode3.2.5.a";
remoteRef = 18C011EC13D5EE01006DFF7A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
18C011EF13D5EE01006DFF7A /* NetworkUnitTests-Xcode3.2.5.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "NetworkUnitTests-Xcode3.2.5.octest";
remoteRef = 18C011EE13D5EE01006DFF7A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6E6454A71184D42800F08CB1 /* libThree20Style.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down
4 changes: 2 additions & 2 deletions src/Three20Core/Sources/Three20Version.m
Expand Up @@ -18,6 +18,6 @@

/*! \mainpage Three20 API Documentation
*
* Generated from Three20 Release <a href="http://three20.info/roadmap/1.0.5">1.0.5</a>.
* Generated from Three20 Release <a href="http://three20.info/roadmap/1.0.7">1.0.7</a>.
*/
NSString* const Three20Version = @"1.0.6.2";
NSString* const Three20Version = @"1.0.7";
3 changes: 1 addition & 2 deletions src/Three20Network/Sources/TTURLCache.m
Expand Up @@ -264,8 +264,7 @@ - (UIImage*)loadImageFromBundle:(NSString*)URL {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIImage*)loadImageFromDocuments:(NSString*)URL {
NSString* path = TTPathForDocumentsResource([URL substringFromIndex:12]);
NSData* data = [NSData dataWithContentsOfFile:path];
return [UIImage imageWithData:data];
return [UIImage imageWithContentsOfFile:path];
}


Expand Down
7 changes: 4 additions & 3 deletions src/Three20Network/Sources/TTURLImageResponse.m
Expand Up @@ -61,12 +61,13 @@ - (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)r
// TODO(jverkoey Feb 10, 2010): This logic doesn't entirely make sense. Why don't we just store
// the data in the cache if there was a cache miss, and then just retain the image data we
// downloaded? This needs to be tested in production.
UIImage* image = [[TTURLCache sharedCache] imageForURL:request.urlPath fromDisk:NO];

UIImage* image = nil;
if(!(request.cachePolicy | TTURLRequestCachePolicyNoCache)) {
image = [[TTURLCache sharedCache] imageForURL:request.urlPath fromDisk:NO];
}
if (nil == image) {
image = [UIImage imageWithData:data];
}

if (nil != image) {
if (!request.respondedFromCache) {
// XXXjoe Working on option to scale down really large images to a smaller size to save memory
Expand Down
58 changes: 0 additions & 58 deletions src/Three20Network/Three20Network.xcodeproj/project.pbxproj
Expand Up @@ -42,7 +42,6 @@
664B29C212848AAD0008D569 /* TTErrorCodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 664B29C012848AAD0008D569 /* TTErrorCodes.m */; };
664B29C312848AAD0008D569 /* TTErrorCodes.m in Sources */ = {isa = PBXBuildFile; fileRef = 664B29C012848AAD0008D569 /* TTErrorCodes.m */; };
66C16B1C1263059A00A7825A /* libThree20Network-Xcode3.2.5.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 662D81EF12630516005851C2 /* libThree20Network-Xcode3.2.5.a */; };
66C16B21126305AB00A7825A /* libThree20Core-Xcode3.2.5.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 66C16AC31263027400A7825A /* libThree20Core-Xcode3.2.5.a */; };
66F955B0126662E300BEF6F0 /* NetworkURLCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 66F955AF126662E300BEF6F0 /* NetworkURLCacheTests.m */; };
66F955B1126662E300BEF6F0 /* NetworkURLCacheTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 66F955AF126662E300BEF6F0 /* NetworkURLCacheTests.m */; };
66F955BA1266647A00BEF6F0 /* both.png in Resources */ = {isa = PBXBuildFile; fileRef = 66F955B71266647A00BEF6F0 /* both.png */; };
Expand Down Expand Up @@ -87,34 +86,6 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
662D824C12630805005851C2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6EE7366611849C5800A35176 /* Three20Core.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 664961541262EE5000C2C80E;
remoteInfo = "UnitTests-Xcode3.2.5";
};
662D82E012639FCA005851C2 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6EE7366611849C5800A35176 /* Three20Core.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 664961541262EE5000C2C80E;
remoteInfo = "UnitTests-Xcode3.2.5";
};
66C16AC21263027400A7825A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6EE7366611849C5800A35176 /* Three20Core.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 6650CAA21262F6E2003FF804;
remoteInfo = "Three20Core-Xcode3.2.5";
};
66C16AC61263027400A7825A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6EE7366611849C5800A35176 /* Three20Core.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 664961641262EE5000C2C80E;
remoteInfo = "UnitTests-Xcode3.2.5";
};
66C16B26126305F500A7825A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
Expand Down Expand Up @@ -214,7 +185,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
66C16B21126305AB00A7825A /* libThree20Core-Xcode3.2.5.a in Frameworks */,
66C16B1C1263059A00A7825A /* libThree20Network-Xcode3.2.5.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -439,9 +409,7 @@
isa = PBXGroup;
children = (
6EE7366C11849C5800A35176 /* libThree20Core.a */,
66C16AC31263027400A7825A /* libThree20Core-Xcode3.2.5.a */,
6EE7366E11849C5800A35176 /* CoreUnitTests.octest */,
66C16AC71263027400A7825A /* CoreUnitTests-Xcode3.2.5.octest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -522,7 +490,6 @@
buildRules = (
);
dependencies = (
662D824D12630805005851C2 /* PBXTargetDependency */,
66C16B27126305F500A7825A /* PBXTargetDependency */,
);
name = "Three20NetworkUnitTests-Xcode3.2.5";
Expand All @@ -542,7 +509,6 @@
buildRules = (
);
dependencies = (
662D82E112639FCA005851C2 /* PBXTargetDependency */,
);
name = "Three20Network-Xcode3.2.5";
productName = Three20;
Expand Down Expand Up @@ -625,20 +591,6 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
66C16AC31263027400A7825A /* libThree20Core-Xcode3.2.5.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libThree20Core-Xcode3.2.5.a";
remoteRef = 66C16AC21263027400A7825A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
66C16AC71263027400A7825A /* CoreUnitTests-Xcode3.2.5.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = "CoreUnitTests-Xcode3.2.5.octest";
remoteRef = 66C16AC61263027400A7825A /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
6EE7366C11849C5800A35176 /* libThree20Core.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -798,16 +750,6 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
662D824D12630805005851C2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "UnitTests-Xcode3.2.5";
targetProxy = 662D824C12630805005851C2 /* PBXContainerItemProxy */;
};
662D82E112639FCA005851C2 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "UnitTests-Xcode3.2.5";
targetProxy = 662D82E012639FCA005851C2 /* PBXContainerItemProxy */;
};
66C16B27126305F500A7825A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 662D81C912630516005851C2 /* Three20Network-Xcode3.2.5 */;
Expand Down
5 changes: 5 additions & 0 deletions src/Three20UI/Headers/TTImageView.h
Expand Up @@ -76,6 +76,11 @@
*/
@property (nonatomic, assign) id<TTImageViewDelegate> delegate;

/**
* The TTURLRequest requester used to load this image.
*/
@property (nonatomic, readonly) TTURLRequest* request;

/**
* Cancel any pending request, remove the image, and redraw the view.
*/
Expand Down
7 changes: 7 additions & 0 deletions src/Three20UI/Headers/TTImageViewDelegate.h
Expand Up @@ -38,4 +38,11 @@
*/
- (void)imageView:(TTImageView*)imageView didFailLoadWithError:(NSError*)error;

/**
* Called before the image view send a network request.
* At this point we have the opportunity to configure the requester
* with some custom options (to use ETAGs, for example).
*/
- (void)imageView:(TTImageView*)imageView willSendARequest:(TTURLRequest*)requester;

@end

0 comments on commit 41bdb73

Please sign in to comment.